A second attempt at writing a compiler in C, to learn about parsing, lexical analysis, context free grammars, abstract syntax trees, code generation, and all sorts of other stuff involved with writing a compiler.
Compiles a subset of C to x86 assembly.
Compile with make
and then run ./i8c file.c
to compile the file using i8c. This creates an assembly file file.s
, which can be assembled using GCC, it will also print out the AST created.
There are some tests that I wrote to have some protection against regression faults. They can be run with make test
.
This does not actually conform to any official C language standard. Atleast for now it's more of a compiler for a 'C-like' language then exactly C.
It's for learning purposes, not actual use.
- A Preprocessor
- Casting
- Arrays
- Typedefs
- Enums
- Lots more...