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%2FEExternalConstant.java;h=788483dbe475ba82d33c41496e1e0bef5ef08feb;hb=a04614760395f09f5e9e3d38226b72f1b8e3d7ba;hp=4777b2dfb670650ecff46e9b258a3c271ab419b1;hpb=862c09c9608329f326404342d12da61792eece2c;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EExternalConstant.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EExternalConstant.java index 4777b2dfb..788483dbe 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EExternalConstant.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EExternalConstant.java @@ -8,12 +8,10 @@ import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext; import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext; import org.simantics.scl.compiler.elaboration.contexts.TranslationContext; import org.simantics.scl.compiler.elaboration.contexts.TypingContext; -import org.simantics.scl.compiler.environment.Environment; import org.simantics.scl.compiler.errors.Locations; import org.simantics.scl.compiler.internal.codegen.references.IVal; import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter; import org.simantics.scl.compiler.internal.codegen.writer.ModuleWriter; -import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator; import org.simantics.scl.compiler.internal.interpreted.IConstant; import org.simantics.scl.compiler.internal.interpreted.IExpression; import org.simantics.scl.compiler.top.ExpressionInterpretationContext; @@ -21,10 +19,6 @@ 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 EExternalConstant extends Expression { Object value; @@ -37,34 +31,21 @@ public class EExternalConstant extends Expression { return value; } - public void collectRefs(TObjectIntHashMap allRefs, TIntHashSet refs) { - } - - @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 { - throw new InternalCompilerError("EExternalConstants must have explicitly defined type."); - } - - @Override - public IVal toVal(CompilationContext context, CodeWriter w) { - ModuleWriter mw = w.getModuleWriter(); - return mw.getExternalConstant(value, getType()); + @Override + protected void updateType() throws MatchException { + throw new InternalCompilerError("EExternalConstants must have explicitly defined type."); } @Override - public void collectFreeVariables(THashSet vars) { + public IVal toVal(CompilationContext context, CodeWriter w) { + ModuleWriter mw = w.getModuleWriter(); + return mw.getExternalConstant(value, getType()); } - @Override public Expression simplify(SimplificationContext context) { return this; @@ -90,23 +71,10 @@ public class EExternalConstant extends Expression { return new EExternalConstant(value, getType().replace(context.tvarMap)); } - @Override - public void removeFreeVariables(THashSet vars) { - } - @Override public Expression inferType(TypingContext context) { return this; } - - @Override - public Expression decorate(ExpressionDecorator decorator) { - return decorator.decorate(this); - } - - @Override - public void collectEffects(THashSet effects) { - } @Override public void setLocationDeep(long loc) { @@ -123,10 +91,6 @@ public class EExternalConstant extends Expression { public IExpression toIExpression(ExpressionInterpretationContext context) { return new IConstant(value); } - - @Override - public void forVariables(VariableProcedure procedure) { - } @Override public Expression accept(ExpressionTransformer transformer) {