diff --git a/output/ClassCanBeTyped.class b/output/ClassCanBeTyped.class deleted file mode 100644 index 404c65b..0000000 Binary files a/output/ClassCanBeTyped.class and /dev/null differ diff --git a/src/main/java/de/maishai/Compiler.java b/src/main/java/de/maishai/Compiler.java index 08a70a1..9a06d14 100644 --- a/src/main/java/de/maishai/Compiler.java +++ b/src/main/java/de/maishai/Compiler.java @@ -98,9 +98,7 @@ public class Compiler { } public static void main(String[] args) { - generateByteCodeFileFromFile(List.of("src/main/resources/JavaTestfiles/ClassWithConstructor.java", - "src/main/resources/JavaTestfiles/ClassWithConstructorAndMethodCall.java", - "src/main/resources/JavaTestfiles/ComplexClass.java"), - List.of("ClassWithConstructor","ClassWithConstructorAndMethodCall","ComplexClass")); + generateByteCodeFileFromFile(List.of("src/main/resources/JavaTestfiles/ClassCanBeBytecoded.java"), + List.of("ClassCanBeBytecoded")); } } diff --git a/src/main/java/de/maishai/typedast/MethodContext.java b/src/main/java/de/maishai/typedast/MethodContext.java index f252656..2c12164 100644 --- a/src/main/java/de/maishai/typedast/MethodContext.java +++ b/src/main/java/de/maishai/typedast/MethodContext.java @@ -15,23 +15,20 @@ public class MethodContext { public record LocalVariable(String name, int index, Type type) { } - private Label startLabel; - private Label endLabel; private MethodVisitor mv; - private ClassContext classContext; + private final ClassContext classContext; private int localVarIndex = 0; private final Map variableIndex = new HashMap<>(); private Stack stack = new Stack<>(); private int maxStack = 0; + //used to jump out of loops with break + private final Stack