diff --git a/bin/.gitignore b/bin/.gitignore index 4ce50fc9..5b035d51 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,6 +1,7 @@ -/de -/plugindevelopment -/mycompiler -/mytypereconstruction -/syntaxTree -/userinterface +/bytecode/ +/de/ +/log4jTesting.xml +/mycompiler/ +/parser/ +/plugindevelopment/ +/syntaxTree/ diff --git a/src/de/dhbwstuttgart/syntaxtree/Class.java b/src/de/dhbwstuttgart/syntaxtree/Class.java index 275666dd..2b280441 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Class.java +++ b/src/de/dhbwstuttgart/syntaxtree/Class.java @@ -1134,10 +1134,11 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit if(t instanceof GenericTypeVar)this.genericClassParameters.add((GenericTypeVar)t); else this.genericClassParameters.add(new GenericTypeVar(t.get_Name(),this,-1)); } + /* for(GenericTypeVar gtv : this.getGenericParameter()){ gtv.setParentClass(this);; } - + */ //TODO: Umwandlung zu RefTypes funktioniert noch nicht richtig. (siehe LambdaTest2) //Als RefType geparste Generische Variablen umwandeln: this.wandleRefTypeAttributes2GenericAttributes(); @@ -1153,8 +1154,8 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit Vector ret = new Vector(); for(Field f : this.getFields()){ ret.add(f); - ret.addAll(this.getGenericParameter()); } + ret.addAll(this.getGenericParameter()); return ret; } diff --git a/src/de/dhbwstuttgart/syntaxtree/Field.java b/src/de/dhbwstuttgart/syntaxtree/Field.java index baefaddd..51766f7a 100644 --- a/src/de/dhbwstuttgart/syntaxtree/Field.java +++ b/src/de/dhbwstuttgart/syntaxtree/Field.java @@ -158,6 +158,7 @@ public abstract class Field extends SyntaxTreeNode implements TypeInsertable, Ty public Vector getChildren() { Vector ret = new Vector<>(); if(this.getType()!=null)ret.add(this.getType()); + ret.addAll(this.getGenericParameter()); return ret; } diff --git a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java index ebf61dd9..3fb4cf61 100644 --- a/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java +++ b/src/de/dhbwstuttgart/syntaxtree/FieldDeclaration.java @@ -101,7 +101,6 @@ public class FieldDeclaration extends Field{ public void parserPostProcessing(SyntaxTreeNode parent){ super.parserPostProcessing(parent); if(this.getType() == null)this.setType(TypePlaceholder.fresh(this)); - } @Override diff --git a/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java b/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java index addee2d7..3eed701b 100644 --- a/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java +++ b/src/de/dhbwstuttgart/syntaxtree/SyntaxTreeNode.java @@ -103,7 +103,7 @@ public abstract class SyntaxTreeNode implements IItemWithOffset{ */ } - + } public boolean seesType(Type tA2) { diff --git a/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java b/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java index aad481a7..d75715df 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/BoundedGenericTypeVar.java @@ -7,6 +7,7 @@ package de.dhbwstuttgart.syntaxtree.type; import java.util.Vector; import de.dhbwstuttgart.syntaxtree.Class; +import de.dhbwstuttgart.syntaxtree.SyntaxTreeNode; import de.dhbwstuttgart.typeinference.ConstraintType; import de.dhbwstuttgart.typeinference.ConstraintsSet; import de.dhbwstuttgart.typeinference.SingleConstraint; @@ -55,7 +56,7 @@ public class BoundedGenericTypeVar extends GenericTypeVar */ // ino.method.BoundedGenericTypeVar.29409.definition - public BoundedGenericTypeVar(String s, Vector bounds, Class parentClass, int offset, int endOffset) + public BoundedGenericTypeVar(String s, Vector bounds, SyntaxTreeNode parentClass, int offset, int endOffset) // ino.end // ino.method.BoundedGenericTypeVar.29409.body { @@ -147,5 +148,12 @@ public class BoundedGenericTypeVar extends GenericTypeVar } // ino.end + @Override + public Vector getChildren() { + Vector ret = super.getChildren(); + ret.addAll(this.bounds); + return ret; + } + } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/GenericTypeVar.java b/src/de/dhbwstuttgart/syntaxtree/type/GenericTypeVar.java index c153ebd3..7a7d0051 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/GenericTypeVar.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/GenericTypeVar.java @@ -36,7 +36,6 @@ public class GenericTypeVar extends Type //Type genericTypeVar; //Vector extendVars = new Vector(); protected Pair genericConstraint; - private Class parent; /** * Eine Registry f�r alle Generic-Instanzen, die vor der Bytecode-Generierung durch * Ihre Superklasse ersetzt werden m�ssen. Siehe "Type Erasure" in Sun Spezifikation. @@ -63,7 +62,7 @@ public class GenericTypeVar extends Type */ // ino.method.GenericTypeVar.26509.definition - public GenericTypeVar(String s, Class parentClass, int offset) + public GenericTypeVar(String s, SyntaxTreeNode parentClass, int offset) // ino.end // ino.method.GenericTypeVar.26509.body { @@ -218,18 +217,6 @@ public class GenericTypeVar extends Type public int getEndOffset() { return this.getOffset() + this.name.toString().length(); } - - public void setParentClass(Class parent){ - //TODO: Die Methode sollte mit neuem Parser raus und dafür nur noch im Konstruktor gesetzt werden. - this.parent = parent; - } - - public Class getParentClass() { - if(this.parent == null) - throw new DebugException("GenericTypeVar ohne Elternelement"); - return this.parent; - } - } // ino.end diff --git a/src/de/dhbwstuttgart/syntaxtree/type/Type.java b/src/de/dhbwstuttgart/syntaxtree/type/Type.java index b4ff5290..c2029e2b 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/Type.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/Type.java @@ -36,17 +36,17 @@ public class Type extends SyntaxTreeNode implements IItemWithOffset // ino.end // ino.method.Type.26729.definition - public Type(String s, int offset) + public Type(String s, SyntaxTreeNode parent, int offset) // ino.end // ino.method.Type.26729.body { - this(offset); + this(parent, offset); this.name = new JavaClassName(s); } // ino.end // ino.method.Type.26732.definition - public Type(int offset) + public Type(SyntaxTreeNode parent,int offset) // ino.end // ino.method.Type.26732.body {