NichtHaskell/Source/abstractSyntaxTree/Program.java
Krauß, Josefine 370b2dbb06 delete modifier
2024-05-08 13:51:00 +02:00

32 lines
994 B
Java

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<RefType> classes;
public HashMap<String, HashMap<String, String>> attributContext; // (class, (type, identifier))
public HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext; // (class, (returntype, (identifier, parameter)))
public TypeCheckResult typeCheck() throws Exception{
for(RefType oneClass : classes){
HashMap<String, String> 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();
}
}
}