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%2FELiteral.java;h=bef28f20ff298a75b65f594cf4bbea08446017d7;hp=d2a671a1d96cdd1a3a60b451061acd897b42d067;hb=666ee533a3cfa9f59e79215a269f8342227cdbda;hpb=dcb08ba8db427e1e9951e61892c653c23977a8cc diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELiteral.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELiteral.java index d2a671a1d..bef28f20f 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELiteral.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ELiteral.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.compilation.CompilationContext; import org.simantics.scl.compiler.constants.Constant; @@ -14,14 +16,9 @@ import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter; import org.simantics.scl.compiler.internal.interpreted.IConstant; 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 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 ELiteral extends Expression { Constant value; @@ -38,34 +35,26 @@ public class ELiteral extends Expression { public Constant getValue() { return value; } - - public void collectRefs(TObjectIntHashMap allRefs, TIntHashSet refs) { + + @Override + public Set getFreeVariables() { + return Collections.emptySet(); } - @Override - public void collectVars(TObjectIntHashMap allVars, - TIntHashSet vars) { - } - - public void toString(StringBuilder b, TypeUnparsingContext tuc) { + public void toString(StringBuilder b, TypeUnparsingContext tuc) { b.append(value); } - - @Override - protected void updateType() throws MatchException { - setType(value.getType()); - } - @Override - public IVal toVal(CompilationContext context, CodeWriter w) { - return value; + @Override + protected void updateType() throws MatchException { + setType(value.getType()); } @Override - public void collectFreeVariables(THashSet vars) { + public IVal toVal(CompilationContext context, CodeWriter w) { + return value; } - @Override public Expression simplify(SimplificationContext context) { return this; @@ -91,10 +80,6 @@ public class ELiteral extends Expression { return new ELiteral(value); } - @Override - public void removeFreeVariables(THashSet vars) { - } - @Override public IExpression toIExpression(ExpressionInterpretationContext target) { return new IConstant(value.realizeValue(target.localClassBuilder)); @@ -104,10 +89,6 @@ public class ELiteral extends Expression { public Expression inferType(TypingContext context) { return this; } - - @Override - public void collectEffects(THashSet effects) { - } @Override public void setLocationDeep(long loc) {