]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EExternalConstant.java
(refs #7375) Replaced collectEffects by CollectEffectsVisitor
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EExternalConstant.java
index 4777b2dfb670650ecff46e9b258a3c271ab419b1..213c30bf198b323da9806fa973827f36d68a7be7 100644 (file)
@@ -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;
@@ -37,27 +35,24 @@ public class EExternalConstant extends Expression {
         return value;
     }
 
-       public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
+    @Override
+    public void collectVars(TObjectIntHashMap<Variable> allVars,
+            TIntHashSet vars) {            
     }
 
-       @Override
-       public void collectVars(TObjectIntHashMap<Variable> 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 IVal toVal(CompilationContext context, CodeWriter w) {
+        ModuleWriter mw = w.getModuleWriter();
+        return mw.getExternalConstant(value, getType());
     }
 
     @Override
@@ -98,15 +93,6 @@ public class EExternalConstant extends Expression {
     public Expression inferType(TypingContext context) {
         return this;
     }
-
-    @Override
-    public Expression decorate(ExpressionDecorator decorator) {
-        return decorator.decorate(this);
-    }
-
-    @Override
-    public void collectEffects(THashSet<Type> effects) {
-    }
     
     @Override
     public void setLocationDeep(long loc) {
@@ -123,10 +109,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) {