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%2FETransformation.java;h=c23c05886065672d9ff24ba95d3ef8ee10e8284e;hb=0861b325fcbbfa8c5985f1e11cfc39154a3808d1;hp=e00514151f335c6772b6c761da66a51a4dbecefb;hpb=747231cca0974ca9ed5f78caa6517ee9dcb8e4fc;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ETransformation.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ETransformation.java index e00514151..c23c05886 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ETransformation.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ETransformation.java @@ -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 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 allVars, - TIntHashSet vars) { - seed.collectVars(allVars, vars); - } - @Override protected void updateType() throws MatchException { setType(Types.UNIT); } - - @Override - public void collectFreeVariables(THashSet 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,21 +79,10 @@ public class ETransformation extends SimplifiableExpression { } } - @Override - public void collectEffects(THashSet effects) { - effects.add(Types.PROC); - //seed.collectEffects(Query.RW, effects); // FIXME - } - @Override public void accept(ExpressionVisitor visitor) { visitor.visit(this); } - - @Override - public void forVariables(VariableProcedure procedure) { - seed.forVariables(procedure); - } @Override public Expression accept(ExpressionTransformer transformer) {