Compiler Written in C++

The compiler was written from scratch and no tools like yacc, or lex were used. Everything from the lexer to the code generator are all from scratch and unit tested.

The language is toy language that has the common language constructs. It is also a staticly typed class(OOP) based language.

The compiler is a LL1 top down table driven parser with multiple passes. This removes the need for forward declaring, and can allow for independant ordering of declarations.

The code generated is built for the moon processor. It is a very simple RISC language. The backend can be reconfigured to output any instruction set, as their is a intermediate representation.

See On Github

The Challenges

Lexical Analysis

Syntactic Analysis

Semantic Analysis

Code Generation