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%2FEConstant.java;h=a668fe12b1cb036f17c69d477283bf01a0dc488f;hb=4ebc60b24db646dc2c64dd54190b029b8e28d030;hp=4a2e07f431cd9410889c2275980aaf70819dc55f;hpb=2df6133d08115f25494f7f8009b6601862895f6c;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EConstant.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EConstant.java index 4a2e07f43..a668fe12b 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EConstant.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EConstant.java @@ -1,6 +1,8 @@ package org.simantics.scl.compiler.elaboration.expressions; import java.util.ArrayList; +import java.util.Collections; +import java.util.Set; import org.simantics.scl.compiler.common.names.Name; import org.simantics.scl.compiler.common.precedence.Precedence; @@ -30,10 +32,6 @@ import org.simantics.scl.compiler.types.exceptions.MatchException; import org.simantics.scl.compiler.types.util.MultiFunction; import org.simantics.scl.compiler.types.util.TypeUnparsingContext; -import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.THashSet; -import gnu.trove.set.hash.TIntHashSet; - public class EConstant extends Expression { public SCLValue value; Type[] typeParameters; @@ -82,10 +80,10 @@ public class EConstant extends Expression { setType(Types.instantiate(getType(), type)); return this; } - + @Override - public void collectVars(TObjectIntHashMap allVars, - TIntHashSet vars) { + public Set getFreeVariables() { + return Collections.emptySet(); } public void toString(StringBuilder b, TypeUnparsingContext tuc) { @@ -106,17 +104,13 @@ public class EConstant extends Expression { setType(Types.instantiate(value.getType(), typeParameters)); } - @Override - public IVal toVal(CompilationContext context, CodeWriter w) { - IVal val = value.getValue(); - if(typeParameters.length > 0) { - val = val.createSpecialization(typeParameters); - } - return val; - } - @Override - public void collectFreeVariables(THashSet vars) { + public IVal toVal(CompilationContext context, CodeWriter w) { + IVal val = value.getValue(); + if(typeParameters.length > 0) { + val = val.createSpecialization(typeParameters); + } + return val; } @Override @@ -151,10 +145,6 @@ public class EConstant extends Expression { public Expression resolveAsPattern(TranslationContext context) { return this; } - - @Override - public void removeFreeVariables(THashSet vars) { - } @Override public Expression replace(ReplaceContext context) { @@ -230,11 +220,7 @@ public class EConstant extends Expression { @Override public boolean isEffectful() { - return false; - } - - @Override - public void collectEffects(THashSet effects) { + return false; } @Override