Removed TODOs that are no longer needed
This commit is contained in:
parent
5dd3821ecb
commit
41d5cd428c
@ -41,7 +41,6 @@ public class InstVarExpression extends AbstractType implements IExpression{
|
||||
}
|
||||
TypeCheckResult result = new TypeCheckResult();
|
||||
result.type = varType;
|
||||
//TODO: Needed for methodCall codeGen
|
||||
setTypeCheckResult(result);
|
||||
return result;
|
||||
}
|
||||
|
@ -120,7 +120,6 @@ public class BlockStatement extends AbstractType implements IStatement {
|
||||
// Create a new HashMap for the local variables of the block
|
||||
// It has every variable of the parent block
|
||||
// This Map is discarded at the end of the block
|
||||
//TODO: Do this for every block --> if, while, ...
|
||||
LinkedHashMap<String, String> blockLocalVars = new LinkedHashMap<>(localVars);
|
||||
|
||||
for (IStatement statement : statements) {
|
||||
|
@ -55,6 +55,8 @@ public class IfElseStatement extends AbstractType implements IStatement{
|
||||
|
||||
|
||||
//TODO: There are 2 NOPs and one athrow on the stack between the if-Block and else-Block execution --> I have no idea why
|
||||
// I think they are generated because of the jump operations below and can not be eliminated
|
||||
// as they do not negatively impact the execution of the code logic wise we can ignore them
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, LinkedHashMap<String, String> localVars, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext) throws Exception {
|
||||
|
||||
|
@ -34,9 +34,7 @@ public class ReturnStatement extends AbstractType implements IStatement{
|
||||
return result;
|
||||
}
|
||||
|
||||
//TODO: We do not differentiate between primitive types and reference types
|
||||
// This is a problem at "BinaryExpression" and here because we need to know the type to return
|
||||
// At this point in time we can either return reference types or have an error message
|
||||
|
||||
@Override
|
||||
public void codeGen(MethodVisitor mv, LinkedHashMap<String, String> localVars, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext) throws Exception {
|
||||
|
||||
|
@ -55,8 +55,7 @@ public class WhileStatement extends AbstractType implements IStatement {
|
||||
mv.visitJumpInsn(Opcodes.IFEQ, conditionFalse); // Checks if the condition is false (0)
|
||||
|
||||
statement.codeGen(mv, blockLocalVars, typeContext, methodContext);
|
||||
//TODO: If the block ends with a return statement, we might have to pop it from the stack
|
||||
// So the next iteration starts with a clean stack
|
||||
|
||||
mv.visitJumpInsn(Opcodes.GOTO, LoopStart); // Jump to the start of the while loop
|
||||
|
||||
mv.visitLabel(conditionFalse);
|
||||
|
Loading…
Reference in New Issue
Block a user