Merge remote-tracking branch 'origin/master'
# Conflicts: # Source/abstractSyntaxTree/Class/MethodDecl.java
This commit is contained in:
commit
b8a8a094f4
@ -26,11 +26,6 @@ public class MethodDecl implements IClass {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypeCheckResult typeCheck() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void codeGen(ClassWriter cw) throws Exception {
|
||||
|
||||
|
@ -9,6 +9,7 @@ import abstractSyntaxTree.Program;
|
||||
import jdk.jshell.spi.ExecutionControl;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -56,7 +57,18 @@ public class RefType extends AbstractType implements IClass {
|
||||
// and method declarations and calls their CodeGen methods
|
||||
@Override
|
||||
public void codeGen(ClassWriter cw) throws Exception {
|
||||
throw new ExecutionControl.NotImplementedException("CodeGen not implemented for RefType");
|
||||
|
||||
cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC, name, null,
|
||||
"java/lang/Object", null);
|
||||
|
||||
for (FieldDecl field : fieldDecls) {
|
||||
field.codeGen(cw);
|
||||
}
|
||||
|
||||
for (MethodDecl method : methodDecls) {
|
||||
method.codeGen(cw);
|
||||
}
|
||||
cw.visitEnd();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user