]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java
SCL compiler generates line numbers to bytecode
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EMatch.java
index 0ca1d54427d13a636ca11eca672ea330dd688cef..494bcfb5d6bfc9d93aab0b50bfd2de29c233cbb7 100644 (file)
@@ -17,10 +17,6 @@ import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.compiler.types.Types;
 import org.simantics.scl.compiler.types.kinds.Kinds;
 
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
-import gnu.trove.set.hash.TIntHashSet;
-
 public class EMatch extends Expression {
 
     public Expression[] scrutinee;
@@ -41,15 +37,6 @@ public class EMatch extends Expression {
         this.cases = cases;
     }
 
-    @Override
-    public void collectVars(TObjectIntHashMap<Variable> allVars,
-            TIntHashSet vars) {
-        for(Expression s : scrutinee)
-            s.collectVars(allVars, vars);
-        for(Case case_ : cases)
-            case_.collectVars(allVars, vars);
-    }
-
     @Override
     protected void updateType() {
         setType(cases[0].value.getType());
@@ -67,19 +54,11 @@ public class EMatch extends Expression {
 
         CodeWriter joinPoint = w.createBlock(getType());
         CodeWriter failurePoint = w.createBlock(); // TODO generate only one failurePoint per function
-        PatternMatchingCompiler.split(w, context, scrutineeVals, joinPoint.getContinuation(), failurePoint.getContinuation(), rows);
+        PatternMatchingCompiler.split(location, w, context, scrutineeVals, joinPoint.getContinuation(), failurePoint.getContinuation(), rows);
         failurePoint.throw_(location, Throw.MatchingException, "Matching failure at: " + toString());
         w.continueAs(joinPoint);
         return w.getParameters()[0];
     }
-
-    @Override
-    public void collectFreeVariables(THashSet<Variable> vars) {
-        for(Expression s : scrutinee)
-            s.collectFreeVariables(vars);
-        for(Case case_ : cases)
-            case_.collectFreeVariables(vars);
-    }
     
     @Override
     public Expression simplify(SimplificationContext context) {
@@ -155,17 +134,6 @@ public class EMatch extends Expression {
         setType(Types.UNIT);
         return this;
     }
-
-    @Override
-    public void collectEffects(THashSet<Type> effects) {
-        for(Expression s : scrutinee)
-            s.collectEffects(effects);
-        for(Case case_ : cases) {
-            for(Expression pattern : case_.patterns)
-                pattern.collectEffects(effects);
-            case_.value.collectEffects(effects);
-        }
-    }
     
     @Override
     public void accept(ExpressionVisitor visitor) {