diff --git a/src/de/dhbwstuttgart/strucTypes/Construct.java b/src/de/dhbwstuttgart/strucTypes/Construct.java index 96cc7507..18a42e27 100644 --- a/src/de/dhbwstuttgart/strucTypes/Construct.java +++ b/src/de/dhbwstuttgart/strucTypes/Construct.java @@ -23,6 +23,7 @@ import de.dhbwstuttgart.syntaxtree.GenericTypeVar; import de.dhbwstuttgart.syntaxtree.Method; import de.dhbwstuttgart.syntaxtree.ParameterList; import de.dhbwstuttgart.syntaxtree.statement.Block; +import de.dhbwstuttgart.syntaxtree.type.GenericRefType; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder; @@ -88,10 +89,12 @@ public class Construct extends DefaultASTVisitor { // Schleife über alle FieldConstraints mit ClassType i this.constraintsSet.getFieldConstraints().stream().filter(fc -> fc.getClassType().equals(i)).forEach(fc -> { TypePlaceholder type = TypePlaceholder.fresh(offset); + //TODO welcher Typ für field TPH, GenRT,...? + GenericRefType grt = new GenericRefType(type.getName(), offset); parameterInhTyterm.add(fc.getFieldType()); generics.add(new GenericTypeVar( type.getName(), new ArrayList<>(), offset, offset)); - Field field = new Field(fc.getFieldName(), type, Modifier.PUBLIC, offset); + Field field = new Field(fc.getFieldName(), grt, Modifier.PUBLIC, offset); fielddecl.add(field); }); @@ -104,12 +107,14 @@ public class Construct extends DefaultASTVisitor { GenericDeclarationList gtvDeclarations = new GenericDeclarationList(new ArrayList<>(), offset); List params = new ArrayList<>(); mc.getArguments().stream().map(a -> a.getSupertype()).forEach(supertype -> { + //TODO welcher Typ für argument? TypePlaceholder tph = TypePlaceholder.fresh(offset); params.add(new FormalParameter(tph.getName(), tph, offset)); parameterInhTyterm.add(supertype); generics.add(new GenericTypeVar(tph.getName(), new ArrayList<>(), offset, offset)); }); ParameterList parameterList = new ParameterList(params, offset); + //TODO Welcher returnType für method Method method = new Method(Modifier.PUBLIC, mc.getMethodName(), returnType, parameterList, block, gtvDeclarations, offset); methods.add(method); }); diff --git a/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java b/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java index 4f7774e1..dd4750c2 100644 --- a/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java +++ b/src/de/dhbwstuttgart/strucTypes/printutils/SyntaxTreePrinter.java @@ -390,7 +390,7 @@ public class SyntaxTreePrinter implements ASTVisitor { @Override public void visit(GenericRefType genericRefType) { - throw new NotImplementedException(); + System.out.println("GenRT " + genericRefType.getParsedName()); } @Override