X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FERuleset.java;h=dadf52797d28052416c24961a166ee66657b6c78;hp=e784813d69fec37c9793ccae98a5ccd38fcc2756;hb=6dfe20b0f514b91337fcac4de0267ffd8268be07;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERuleset.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERuleset.java index e784813d6..dadf52797 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERuleset.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERuleset.java @@ -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; @@ -44,13 +43,12 @@ import org.simantics.scl.compiler.types.kinds.Kinds; import gnu.trove.impl.Constants; import gnu.trove.map.hash.THashMap; import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.THashSet; import gnu.trove.set.hash.TIntHashSet; public class ERuleset extends SimplifiableExpression { LocalRelation[] relations; - DatalogRule[] rules; - Expression in; + public DatalogRule[] rules; + public Expression in; public ERuleset(LocalRelation[] relations, DatalogRule[] rules, Expression in) { this.relations = relations; @@ -95,12 +93,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) { @@ -136,30 +128,7 @@ public class ERuleset extends SimplifiableExpression { in = in.checkIgnoredType(context); return compile(context); } - - @Override - public void collectFreeVariables(THashSet vars) { - for(DatalogRule rule : rules) { - for(Expression parameter : rule.headParameters) - parameter.collectFreeVariables(vars); - rule.body.collectFreeVariables(vars); - for(Variable var : rule.variables) - vars.remove(var); - } - in.collectFreeVariables(vars); - } - - @Override - public void collectRefs(TObjectIntHashMap 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 allVars, TIntHashSet vars) { @@ -171,16 +140,6 @@ public class ERuleset extends SimplifiableExpression { in.collectVars(allVars, vars); } - @Override - public void collectEffects(THashSet 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 +365,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) {