Deleted TODOs which are done
This commit is contained in:
parent
b787b333fb
commit
d1da1c6eee
@ -49,7 +49,6 @@ public class FieldDecl extends AbstractType implements Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void codeGen(ClassWriter cw) {
|
public void codeGen(ClassWriter cw) {
|
||||||
//TODO: Do we have fields with initial values? --> No dont think so --> assign
|
|
||||||
FieldVisitor fv = cw.visitField(Opcodes.ACC_PUBLIC, identifier, getFieldDescriptor(), null, null);
|
FieldVisitor fv = cw.visitField(Opcodes.ACC_PUBLIC, identifier, getFieldDescriptor(), null, null);
|
||||||
fv.visitEnd();
|
fv.visitEnd();
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,6 @@ public class MethodDecl implements Node {
|
|||||||
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
mv.visitVarInsn(Opcodes.ALOAD, 0);
|
||||||
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
|
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
|
||||||
|
|
||||||
//TODO: Initialize the fields of the class
|
|
||||||
HashMap<String, String> classFields = typeContext.get(classThatContainsMethod);
|
HashMap<String, String> classFields = typeContext.get(classThatContainsMethod);
|
||||||
|
|
||||||
for (Map.Entry<String, String> entry : classFields.entrySet()) {
|
for (Map.Entry<String, String> entry : classFields.entrySet()) {
|
||||||
|
@ -52,8 +52,7 @@ public class Program implements Node {
|
|||||||
}
|
}
|
||||||
methodContext.put(oneClass.name, identifierAndMethod);
|
methodContext.put(oneClass.name, identifierAndMethod);
|
||||||
}
|
}
|
||||||
//TODO: uncomment this code
|
|
||||||
/*
|
|
||||||
int mainCounter = 0;
|
int mainCounter = 0;
|
||||||
// check if main exists
|
// check if main exists
|
||||||
for(RefType oneClass : classes){
|
for(RefType oneClass : classes){
|
||||||
@ -62,7 +61,6 @@ public class Program implements Node {
|
|||||||
}
|
}
|
||||||
if(mainCounter != 1)
|
if(mainCounter != 1)
|
||||||
throw new TypeCheckException("There is not 1 Main method.");
|
throw new TypeCheckException("There is not 1 Main method.");
|
||||||
*/
|
|
||||||
|
|
||||||
// typecheck each class
|
// typecheck each class
|
||||||
TypeCheckResult result = new TypeCheckResult();
|
TypeCheckResult result = new TypeCheckResult();
|
||||||
|
Loading…
Reference in New Issue
Block a user