Merge remote-tracking branch 'origin/main'

This commit is contained in:
i22011 2024-05-08 10:41:28 +02:00
commit d0448b01cd

View File

@ -3,6 +3,7 @@ package bytecode;
import java.io.FileOutputStream;
import java.io.IOException;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import parser.ClassDeclarationNode;
import parser.ProgramNode;
@ -14,7 +15,15 @@ public class ByteCodeGenerator {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC, classDeclarationNode.identifier, null,
"java/lang/Object", null);
MethodVisitor constructor =
cw.visitMethod(Opcodes.ACC_PUBLIC,
"<init>",
"()V",
null,
null);
cw.visitEnd();
printIntoClassFile(cw.toByteArray(), classDeclarationNode.identifier);
}
}