The goal is to create a CLR compiler for Foundry, my research project for this year.
Let message = “Hello World”
- File level parser. This needs to understand import statements and function blocks, but not the contents of functions.
- Level 1 symbol table. Requires reflecting over core assemblies
- Parsing let-style variable statements. This will require an abstract syntax tree with nodes that can later be annotated with type information.
- Level 3 symbol table for storing locals. (Level 2 is for class-level symbols, which donof’t apply to free functions. Levels 4+ are for nested structures)
- Parsing simple function calls.
- Emitting a free function as IL code.
Abstract Syntax for File-Level Parser
<Function> <Identifier “Main”>
The file-level parser doesn’t concern itself with the contents of functions. This allows us some degree of error recovery, as one bad function will not prevent us from parsing the remainder of the file.
Proposed object model (using XML notation because I don’t feel like drawing diagrams tonight)
<Function Name=”Main” />
Deadline: My self-imposed deadline is March 12, which allows for weekly milestones.