forked from JavaTX/JavaCompilerCore
Fehler in Construct für Typen der Felder, und Methoden der generierten Interfaces markiert mit //TODO
This commit is contained in:
parent
3ed300268f
commit
48e22982c8
@ -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<FormalParameter> 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);
|
||||
});
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user