package org.simantics.scl.compiler.types.util; import org.simantics.scl.compiler.types.Skeletons; import org.simantics.scl.compiler.types.TMetaVar; import org.simantics.scl.compiler.types.Type; public class TypeTree { public static class Case { public Type[] types; public T result; } private static class Node { Case[] cases; Branch[] branches; public Node(Case[] cases) { this.cases = cases; this.branches = new Branch[cases[0].types.length]; } Branch getBranch(int i) { // TODO return null; } } private static class Branch { public void improve(Iterator iterator) { // TODO Auto-generated method stub } } public static class Iterator { Node node; Type[] scrutinee; public Iterator(Node node, Type[] scrutinee) { this.node = node; this.scrutinee = scrutinee; } public void improve() { for(int i=0;i branch = node.getBranch(i); if(branch != null) { branch.improve(this); --i; } } } } } Node root; public TypeTree(Case[] cases) { this.root = new Node(cases); } public Iterator iterator(Type ... scrutinee) { return new Iterator(root, scrutinee); } }