mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-10-06 18:21:40 +00:00
Done TODOs for TypedDoWhile
This commit is contained in:
parent
e9e4f8ccd3
commit
e63d7999a2
@ -75,7 +75,7 @@ public class TypedBlock implements TypedNode {
|
|||||||
}
|
}
|
||||||
if (stmt instanceof DoWhile doWhile) {
|
if (stmt instanceof DoWhile doWhile) {
|
||||||
TypedDoWhile typedDoWhile = new TypedDoWhile(localVar, clas, doWhile);
|
TypedDoWhile typedDoWhile = new TypedDoWhile(localVar, clas, doWhile);
|
||||||
//TODO: check the type
|
typedDoWhile.typeCheck(localVar, clas);
|
||||||
stmts.add(typedDoWhile);
|
stmts.add(typedDoWhile);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -104,7 +104,6 @@ public class TypedBlock implements TypedNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println("typedBlock: " + this.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -13,6 +13,7 @@ import static de.maishai.typedast.Util.TypedExpressionUtil.getKindOfExpression;
|
|||||||
public class TypedDoWhile implements TypedStatement {
|
public class TypedDoWhile implements TypedStatement {
|
||||||
private TypedBlock typedBlock;
|
private TypedBlock typedBlock;
|
||||||
private TypedExpression cond;
|
private TypedExpression cond;
|
||||||
|
private Type type;
|
||||||
|
|
||||||
public TypedDoWhile(Map<String, Type> localVar, TypedClass clas, DoWhile unTypedDoWhile) {
|
public TypedDoWhile(Map<String, Type> localVar, TypedClass clas, DoWhile unTypedDoWhile) {
|
||||||
convertToTypedDoWhile(localVar, clas, unTypedDoWhile);
|
convertToTypedDoWhile(localVar, clas, unTypedDoWhile);
|
||||||
@ -28,6 +29,7 @@ public class TypedDoWhile implements TypedStatement {
|
|||||||
throw new RuntimeException("Condition must be boolean");
|
throw new RuntimeException("Condition must be boolean");
|
||||||
}
|
}
|
||||||
typedBlock.typeCheck(localVar, clas);
|
typedBlock.typeCheck(localVar, clas);
|
||||||
|
this.type = Type.VOID;
|
||||||
return Type.VOID;
|
return Type.VOID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user