X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FECHRRulesetConstructor.java;h=431bd850dd4e8225f74d3c13284073a60b9d588a;hb=b77d6bc2e8713d4138a0af0afb64a97f92a21052;hp=ce0385f815623760edf9a276c6a69e10da7f697a;hpb=747231cca0974ca9ed5f78caa6517ee9dcb8e4fc;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRulesetConstructor.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRulesetConstructor.java index ce0385f81..431bd850d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRulesetConstructor.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRulesetConstructor.java @@ -11,44 +11,25 @@ import org.simantics.scl.compiler.internal.codegen.references.IVal; import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter; import org.simantics.scl.compiler.internal.interpreted.IExpression; import org.simantics.scl.compiler.top.ExpressionInterpretationContext; -import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.exceptions.MatchException; -import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.THashSet; -import gnu.trove.set.hash.TIntHashSet; - public class ECHRRulesetConstructor extends Expression { - CHRRuleset ruleset; + public CHRRuleset ruleset; public ECHRRulesetConstructor(CHRRuleset ruleset) { this.ruleset = ruleset; } - - @Override - public void collectRefs(TObjectIntHashMap allRefs, TIntHashSet refs) { - ruleset.collectRefs(allRefs, refs); - } - @Override - public void collectVars(TObjectIntHashMap allVars, TIntHashSet vars) { - ruleset.collectVars(allVars, vars); - } - @Override - public void forVariables(VariableProcedure procedure) { - ruleset.forVariables(procedure); - } + @Override protected void updateType() throws MatchException { throw new InternalCompilerError("Type of ECHRRulesetConstructor should be already given."); } + @Override public IVal toVal(CompilationContext context, CodeWriter w) { return ruleset.generateCode(w); } - @Override - public void collectFreeVariables(THashSet vars) { - ruleset.collectFreeVariables(vars); - } + @Override public Expression resolve(TranslationContext context) { context.pushFrame(); @@ -66,10 +47,6 @@ public class ECHRRulesetConstructor extends Expression { } } @Override - public void collectEffects(THashSet effects) { - ruleset.collectEffects(effects); - } - @Override public void accept(ExpressionVisitor visitor) { visitor.visit(this); }