Forest of UNIX

Crowlang compiler architecture

So lately in order to keep an overview of my compiler and how I am tackling its development. So I decided to create a little plantuml diagram of the different components and passes. This way I can better keep track of the entirety of the SWE process. This diagram is not an official or well formed class diagram. Whilst most of the diagram is accurate, some things are not complete as of writing.

Crowlang compiler passes

An important note is that as of writing the ModuleUnit is not implemented at all. My desire is to have lexing and parsing be done by the TranslationUnit and when that is complete. To check the TranslationUnit's and if they have the same module name. To merge the AST from the different TranslationUnit's into a single AST. Stored in the ModuleUnit. This will make going forward with semantic analysis, and construction of the symbol table easier.

Having a single large AST with all the code of a module. Will complicate things performance wise, for larger Crowlang projects.

Also as of writing we have a symboltable, which was intended to also solve the order independence issue. But something we need to tackle is likely needing separate symbol tables for semantic analysis, MIR and LLVM IR. We could dump everything in a single symbol table, but this likely wont scale well when the compiler grows.

I am also almost done with the MIR generation from the AST. But not being able to resolve function calls, as of now due to having to face this design decision.