Meo subset c compiler
Let's start
- meo is
🐱 in Vietnamese, but now it is subset c compliler - The project is mainly used to study compiler.
- I use 100DaysOfCode strategy, that will make small step everyday by rule
- I study base on following.
- Reading Compiler design in C - Allen I.Holub
- Reading Dragon book
- Reference A Compiler Writing Journey
Design
- Using design as four-pass compiler, which is refered from Compiler design in C - Allen I.Holub
- Each module lexical analyzer, parser, code generation are designed as independent module, it can be easy to replace without any effect other part.
Implementation
- First step: only supporting X86-64 + pass 2 (lexical analyzer, parser, code generation).
- Using back end of GCC to generate executed code.
- Using TDD with catch2.
- Using Google coding convention.
Todo list
- Run basic math operator +,-,*,/ on X86_64 GNU/Linux -> v0.1
- Compile clgt.c
- Support IF statements -> Can compile if_stmt.c
- Support WHILE statements. -> Can compile while_stmt.c
- Support FOR statements. -> Can compile for_stmt.c
- Support function & function call.
- Global variable & local variable.
- Structure type.
- Full operator (&& & || | ^ !).
- Self compile.