Add Field transform

This commit is contained in:
Victorious3 2022-05-31 14:02:39 +02:00
parent 372182aa8b
commit 0a1a596bb9

View File

@ -35,7 +35,7 @@ public class ASTToTargetAST {
return new TargetClass(input.getModifiers(),input.getClassName().toString(), sigma.get(input.getSuperClass()), return new TargetClass(input.getModifiers(),input.getClassName().toString(), sigma.get(input.getSuperClass()),
input.getSuperInterfaces().stream().map(it -> sigma.get(it)).collect(Collectors.toList()), input.getSuperInterfaces().stream().map(it -> sigma.get(it)).collect(Collectors.toList()),
targetConstructors, targetConstructors,
input.getFieldDecl().stream().map(it -> convert(it)).collect(Collectors.toList()), input.getFieldDecl().stream().map(it -> convert(input, it)).collect(Collectors.toList()),
input.getMethods().stream().map(it -> convert(input, it)).collect(Collectors.toList())); input.getMethods().stream().map(it -> convert(input, it)).collect(Collectors.toList()));
} }
@ -47,7 +47,8 @@ public class ASTToTargetAST {
new TargetRefType(owner.getClassName().getClassName()), new TargetRefType(owner.getClassName().getClassName()),
input.name, params, input.name, params,
convert(input.getReturnType()), convert(input.getReturnType()),
convert(input.block)); convert(input.block)
);
} }
protected TargetBlock convert(Block block) { protected TargetBlock convert(Block block) {
@ -60,8 +61,13 @@ public class ASTToTargetAST {
return converter.result; return converter.result;
} }
private TargetField convert(Field input) { private TargetField convert(ClassOrInterface owner, Field input) {
return null; return new TargetField(
input.modifier,
new TargetRefType(owner.getClassName().getClassName()),
convert(input.getType()),
input.getName()
);
} }
protected TargetType convert(RefTypeOrTPHOrWildcardOrGeneric input) { protected TargetType convert(RefTypeOrTPHOrWildcardOrGeneric input) {