Add initialisition

This commit is contained in:
Ahmad 2024-05-08 15:51:56 +02:00
parent b0fea68f05
commit 9d35956735

View File

@ -1,11 +1,12 @@
package de.maishai.typedast.typedclass;
import de.maishai.ast.records.*;
import de.maishai.ast.records.Class;
import de.maishai.ast.records.Constructor;
import de.maishai.ast.records.Declaration;
import de.maishai.ast.records.Method;
import de.maishai.typedast.CodeGenUtils;
import de.maishai.typedast.TypedNode;
import de.maishai.typedast.Type;
import de.maishai.typedast.TypedStatement;
import de.maishai.typedast.TypedNode;
import lombok.Data;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
@ -51,6 +52,9 @@ public class TypedClass implements TypedNode {
@Override
public TypedNode convertToTypedAST(Map<String, Type> localVar, Map<String, TypedClass> classes, de.maishai.ast.records.Node unTypedAST) {
TypedClass typedClass = new TypedClass();
typedClass.setTypedFields(new ArrayList<>());
typedClass.setTypedMethods(new ArrayList<>());
typedClass.setTypedConstructors(new ArrayList<>());
Class c = (Class) unTypedAST;
for (Declaration field : c.fieldDeclarations()) {