mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 16:28:04 +00:00
Add Type to TypedBlock
This commit is contained in:
parent
34a20668b6
commit
f40318f905
@ -17,11 +17,17 @@ import java.util.Map;
|
||||
public class TypedBlock implements TypedNode {
|
||||
private List<TypedLocalVariable> vars = new ArrayList<>();
|
||||
private List<TypedStatement> stmts = new ArrayList<>();
|
||||
private Type type;
|
||||
|
||||
|
||||
|
||||
public TypedBlock(Map<String, Type> localVar, TypedClass clas, Block unTypedBlock) {
|
||||
blockToTypedBlock(localVar, clas, unTypedBlock);
|
||||
}
|
||||
public TypedBlock(List<TypedLocalVariable> vars, List<TypedStatement> stmts) {
|
||||
this.vars = vars;
|
||||
this.stmts = stmts;
|
||||
}
|
||||
|
||||
public void blockToTypedBlock(Map<String, Type> localVar, TypedClass clas, Block unTypedBlock) {
|
||||
|
||||
@ -90,6 +96,7 @@ public class TypedBlock implements TypedNode {
|
||||
//TODO: implement this
|
||||
}
|
||||
}
|
||||
this.typeCheck(localVar, clas);
|
||||
|
||||
}
|
||||
|
||||
@ -104,8 +111,8 @@ public class TypedBlock implements TypedNode {
|
||||
stmt.typeCheck(localVar, clas);
|
||||
}
|
||||
|
||||
|
||||
return Type.VOID;
|
||||
type = Type.VOID;
|
||||
return type;
|
||||
}
|
||||
|
||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||
|
Loading…
Reference in New Issue
Block a user