package abstractSyntaxTree; import TypeCheck.TypeCheckResult; import abstractSyntaxTree.Class.FieldDecl; import abstractSyntaxTree.Datatype.RefType; import java.util.HashMap; import java.util.List; public class Program { public List classes; public HashMap> typeContext; // (class, (type, identifier)) public HashMap>> methodContext; // (class, (returntype, (identifier, parameter))) public TypeCheckResult typeCheck() throws Exception{ for(RefType oneClass : classes){ HashMap classVars = new HashMap<>(); for (FieldDecl fielsDecl: oneClass.fieldDecls) classVars.put(fielsDecl.type, fielsDecl.identifier); oneClass.typeCheck(); } return null; } public void codeGen() throws Exception{ for(RefType oneClass : classes){ oneClass.codeGen(); } } }