]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ETransformation.java
Make it possible to debug SCL compiler in production builds
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / ETransformation.java
index 3e8f61b036cf8f932895bfaca47879836835210d..c23c05886065672d9ff24ba95d3ef8ee10e8284e 100644 (file)
@@ -11,15 +11,15 @@ import org.simantics.scl.compiler.elaboration.rules.TransformationRule;
 import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.internal.elaboration.transformations.TransformationBuilder;
 import org.simantics.scl.compiler.top.SCLCompilerConfiguration;
-import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.compiler.types.Types;
 import org.simantics.scl.compiler.types.exceptions.MatchException;
-
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
-import gnu.trove.set.hash.TIntHashSet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ETransformation extends SimplifiableExpression {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(ETransformation.class);
+
     public static final Object TRANSFORMATION_RULES_TYPECHECKED = new Object();
     
     public final String name;
@@ -30,32 +30,10 @@ public class ETransformation extends SimplifiableExpression {
         this.seed = seed;
     }
 
-    @Override
-    public void collectRefs(TObjectIntHashMap<Object> allRefs,
-            TIntHashSet refs) {
-        {
-            int ref = allRefs.get(TRANSFORMATION_RULES_TYPECHECKED);
-            if(ref >= 0)
-                refs.add(ref);
-        }
-        seed.collectRefs(allRefs, refs);
-    }
-
-    @Override
-    public void collectVars(TObjectIntHashMap<Variable> allVars,
-            TIntHashSet vars) {
-        seed.collectVars(allVars, vars);
-    }
-
     @Override
     protected void updateType() throws MatchException {
         setType(Types.UNIT);
     }
-
-    @Override
-    public void collectFreeVariables(THashSet<Variable> vars) {
-        seed.collectFreeVariables(vars);
-    }
     
     @Override
     public Expression inferType(TypingContext context) {
@@ -83,7 +61,7 @@ public class ETransformation extends SimplifiableExpression {
         Expression expression = tb.compileRules();
         
         if(SCLCompilerConfiguration.SHOW_COMPILED_RULES)
-            System.out.println(expression);
+            LOGGER.info("{}", expression);
         return expression;
     }
 
@@ -101,12 +79,6 @@ public class ETransformation extends SimplifiableExpression {
         }
     }
 
-    @Override
-    public void collectEffects(THashSet<Type> effects) {
-        effects.add(Types.PROC);
-        //seed.collectEffects(Query.RW, effects); // FIXME
-    }
-
     @Override
     public void accept(ExpressionVisitor visitor) {
         visitor.visit(this);