Merge branch 'refactorToAPIs' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into refactorToAPIs
This commit is contained in:
commit
59c5e48201
@ -20,7 +20,8 @@ public class ASTToTargetAST {
|
||||
public TargetClass convert(ClassOrInterface input, Map<TypePlaceholder, TargetType> sigma){
|
||||
List<TargetConstructor> targetConstructors = new ArrayList<>();
|
||||
//TODO constructor conversion -> also reduce syntactic sugar
|
||||
return new TargetClass(input.getModifiers(),input.getClassName().toString(), sigma.get(input.getSuperClass()),
|
||||
return new TargetClass(input.getModifiers(),input.getClassName().toString(), null,
|
||||
sigma.get(input.getSuperClass()),
|
||||
input.getSuperInterfaces().stream().map(it -> sigma.get(it)).collect(Collectors.toList()),
|
||||
targetConstructors,
|
||||
input.getFieldDecl().stream().map(it -> convert(it, sigma)).collect(Collectors.toList()),
|
||||
@ -42,7 +43,7 @@ public class ASTToTargetAST {
|
||||
}
|
||||
|
||||
private TargetField convert(Field input, Map<TypePlaceholder, TargetType> sigma) {
|
||||
return null;
|
||||
return new TargetField(convert(input.getType(), sigma), input.getName());
|
||||
}
|
||||
|
||||
private TargetType convert(RefTypeOrTPHOrWildcardOrGeneric input, Map<TypePlaceholder, TargetType> sigma) {
|
||||
|
@ -0,0 +1,7 @@
|
||||
package de.dhbwstuttgart.target.tree;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
|
||||
import de.dhbwstuttgart.target.tree.type.TargetType;
|
||||
|
||||
public record GenericDeclaration(GenericRefType generic, TargetType bound) {
|
||||
}
|
@ -5,6 +5,7 @@ import de.dhbwstuttgart.target.tree.type.TargetType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record TargetClass(int modifiers, String qualifiedName, TargetType superType, List<TargetType> implementingInterfaces,
|
||||
public record TargetClass(int modifiers, String qualifiedName, List<GenericDeclaration> generics, TargetType superType,
|
||||
List<TargetType> implementingInterfaces,
|
||||
List<TargetConstructor> constructors, List<TargetField> fields, List<TargetMethod> methods) {}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
package de.dhbwstuttgart.target.tree;
|
||||
|
||||
import de.dhbwstuttgart.target.tree.expression.TargetBlock;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record TargetConstructor(List<MethodParameter> parameterTypes) {
|
||||
public record TargetConstructor(List<MethodParameter> parameterTypes, TargetBlock block) {
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
package de.dhbwstuttgart.target.tree.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public record TargetExtendsWildcard(TargetType innerType) implements TargetType{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user