diff --git a/src/mycompiler/SyntaxTreeNode.java b/src/mycompiler/SyntaxTreeNode.java index f2c58bf6..41883c62 100644 --- a/src/mycompiler/SyntaxTreeNode.java +++ b/src/mycompiler/SyntaxTreeNode.java @@ -2,6 +2,8 @@ package mycompiler; import java.util.Vector; +import typinferenz.ResultSet; +import typinferenz.TypeInsertPoint; import typinferenz.exceptions.DebugException; import typinferenz.exceptions.TypeinferenceException; import mycompiler.myclass.Class; @@ -57,4 +59,12 @@ public abstract class SyntaxTreeNode { if(!this.getParent().equals(equal.getParent()))return false; //auch das Elternelement überprüfen. return true; } + + public Vector> getTypeInsertPoints(ResultSet result) { + Vector> ret = new Vector>(); + for(SyntaxTreeNode node : this.getChildren()){ + ret.addAll(node.getTypeInsertPoints(result)); + } + return ret; + } } diff --git a/src/mycompiler/myclass/Class.java b/src/mycompiler/myclass/Class.java index 97692dac..d6386369 100755 --- a/src/mycompiler/myclass/Class.java +++ b/src/mycompiler/myclass/Class.java @@ -62,11 +62,13 @@ import org.apache.log4j.Logger; + import sun.reflect.generics.reflectiveObjects.NotImplementedException; import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.OderConstraint; import typinferenz.ResultSet; +import typinferenz.TypeInsertPoint; import typinferenz.Typeable; import typinferenz.UndConstraint; import typinferenz.FunN; @@ -1358,5 +1360,6 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit // TODO Auto-generated method stub return 0; } + } // ino.end diff --git a/src/mycompiler/myclass/FormalParameter.java b/src/mycompiler/myclass/FormalParameter.java index d9c787b7..4271a327 100755 --- a/src/mycompiler/myclass/FormalParameter.java +++ b/src/mycompiler/myclass/FormalParameter.java @@ -277,6 +277,14 @@ public class FormalParameter extends SyntaxTreeNode implements ITypeReplacementL return this.declid; } + @Override + public Vector> getTypeInsertPoints(ResultSet result) { + Vector> ret = super.getTypeInsertPoints(result); + if(this.getType() instanceof TypePlaceholder){ + ret.add(((TypePlaceholder)this.getType()).getTypeInsertPoints(result)); + } + return ret; + } } // ino.end diff --git a/src/mycompiler/myclass/Method.java b/src/mycompiler/myclass/Method.java index 35d220a8..e3def173 100755 --- a/src/mycompiler/myclass/Method.java +++ b/src/mycompiler/myclass/Method.java @@ -748,8 +748,6 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable public void setGenericParameter(Vector params) { this.genericMethodParameters = params; } - - } // ino.end diff --git a/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java b/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java index ba1dd17c..cefe7af1 100755 --- a/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java +++ b/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java @@ -115,6 +115,19 @@ public class TypeinferenceResultSet */ public Vector getTypeInsertionPoints(){ Vector ret = new Vector(); + //TODO: Eigentlich sollten die TypeInsertPoints von den Elementen im Syntaxbaum erstellt werden. Momentan wird beides parallel eingesetzt + Vector> TISets = this.ownerOfResultSet.getTypeInsertPoints(this.unifiedConstraints); + for(Vector TIPs : TISets){ + TypeInsertSet toAdd = new TypeInsertSet(); + for(int i = 0; i