X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FECHRRuleset.java;h=12165399321a2496a6148ff77b8d48422a73c164;hb=a8d72a172fdc815c8a9f0f584f010f7e35286f92;hp=d23b2e4cee3b19710a8bf1d855c3144c153fa295;hpb=dcb08ba8db427e1e9951e61892c653c23977a8cc;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRuleset.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRuleset.java index d23b2e4ce..121653993 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRuleset.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ECHRRuleset.java @@ -10,7 +10,6 @@ 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; @@ -26,30 +25,29 @@ public class ECHRRuleset extends Expression { this.in = in; } - @Override - public void collectRefs(TObjectIntHashMap allRefs, TIntHashSet refs) { - ruleset.collectRefs(allRefs, refs); - in.collectRefs(allRefs, refs); - } @Override public void collectVars(TObjectIntHashMap allVars, TIntHashSet vars) { ruleset.collectVars(allVars, vars); in.collectVars(allVars, vars); } + @Override protected void updateType() throws MatchException { setType(in.getType()); } + @Override public IVal toVal(CompilationContext context, CodeWriter w) { ruleset.generateCode(w); return in.toVal(context, w); } + @Override public void collectFreeVariables(THashSet vars) { ruleset.collectFreeVariables(vars); in.collectFreeVariables(vars); } + @Override public Expression resolve(TranslationContext context) { if(context.currentRuleset != null) { @@ -77,11 +75,7 @@ public class ECHRRuleset extends Expression { in.setLocationDeep(loc); } } - @Override - public void collectEffects(THashSet effects) { - ruleset.collectEffects(effects); - in.collectEffects(effects); - } + @Override public void accept(ExpressionVisitor visitor) { visitor.visit(this);