From a39a9273a17484aaa5c6e23e5507d16c1b8c5ce4 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Sat, 22 Feb 2014 05:43:20 +0100 Subject: [PATCH] =?UTF-8?q?=C3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mycompiler/mytype/TypePlaceholder.java | 12 ++++++++++++ .../mytypereconstruction/TypeinferenceResultSet.java | 7 ++++--- src/typinferenz/TypeInsertPoint.java | 6 ++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/mycompiler/mytype/TypePlaceholder.java b/src/mycompiler/mytype/TypePlaceholder.java index c996f9aa..49fdd18d 100755 --- a/src/mycompiler/mytype/TypePlaceholder.java +++ b/src/mycompiler/mytype/TypePlaceholder.java @@ -9,6 +9,8 @@ import java.util.Vector; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; +import typinferenz.TypeInsertPoint; +import typinferenz.TypeInsertable; import mycompiler.MyCompiler; import mycompiler.mytypereconstruction.replacementlistener.CReplaceTypeEvent; import mycompiler.mytypereconstruction.replacementlistener.IReplaceTypeEventProvider; @@ -508,6 +510,16 @@ public class TypePlaceholder extends Type implements IReplaceTypeEventProvider return equalType.printJavaCode(resultSet); } + + public Vector getTypeInsertPoints(ResultSet result) { + Vector ret = new Vector(); + for(ITypeReplacementListener ti : this.m_ReplacementListeners){ + if(ti instanceof TypeInsertable){ + new TypeInsertPoint(this, ti, result.getTypeEqualTo(this)); + } + } + return ret; + } } // ino.end diff --git a/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java b/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java index c5fb7178..e3e9fb31 100755 --- a/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java +++ b/src/mycompiler/mytypereconstruction/TypeinferenceResultSet.java @@ -113,16 +113,17 @@ public class TypeinferenceResultSet } /** - * Berechnet alle möglichen Punkte zum Einsetzen eines Typs im Quelltext + * Berechnet alle möglichen Punkte zum Einsetzen eines Typs im Quelltext an der Stelle dieses TypePlaceholders * @return */ public Vector getTypeInsertionPoints(){ + Vector ret = new Vector(); for(Pair p : constraints){ for(TypePlaceholder tph : p.getTypePlaceholder()){ - + ret.addAll(tph.getTypeInsertPoints(this.unifiedConstraints)); } } - return null; + return ret; } } diff --git a/src/typinferenz/TypeInsertPoint.java b/src/typinferenz/TypeInsertPoint.java index 7c552d7b..94ead554 100644 --- a/src/typinferenz/TypeInsertPoint.java +++ b/src/typinferenz/TypeInsertPoint.java @@ -1,5 +1,11 @@ package typinferenz; +import mycompiler.mytype.*; + public class TypeInsertPoint { + public TypeInsertPoint(TypePlaceholder tph, TypeInsertable insertPoint, Type insertType){ + + } + }