2024-05-08 13:14:58 +00:00
|
|
|
import abstractSyntaxTree.Class.FieldDecl;
|
|
|
|
import abstractSyntaxTree.Class.MethodDecl;
|
|
|
|
import abstractSyntaxTree.Class.RefType;
|
|
|
|
import abstractSyntaxTree.Program;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class Compiler {
|
|
|
|
|
2024-05-09 12:20:55 +00:00
|
|
|
public static void main(String[] args) throws Exception{
|
2024-05-08 13:14:58 +00:00
|
|
|
|
|
|
|
// get file
|
|
|
|
|
2024-05-09 12:28:32 +00:00
|
|
|
Program abstractSyntaxTree = new Program(new ArrayList<>());
|
2024-05-08 13:14:58 +00:00
|
|
|
List<FieldDecl> emptyFieldDecl = new ArrayList<>();
|
|
|
|
List<MethodDecl> emptyMethodDecl = new ArrayList<>();
|
2024-05-09 12:41:07 +00:00
|
|
|
abstractSyntaxTree.classes.add(new RefType(emptyFieldDecl, emptyMethodDecl, null, null, "MyClass"));
|
2024-05-08 13:14:58 +00:00
|
|
|
|
|
|
|
abstractSyntaxTree.typeCheck();
|
|
|
|
|
|
|
|
abstractSyntaxTree.codeGen();
|
|
|
|
}
|
|
|
|
}
|