Skip to content

cameronslee/lil-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lil-compiler

C Compiler
Project began as a stepping stone for another compiler project.
Looking to compare the performance and complexity between an AST and a stack machine for code generation. 
Adheres to the C99 language standard.

Design
This compiler aims to be an efficient single-pass compiler.

Phase 1: Lexer
This is where the tokens will be read into a token stream. The stream is generated from the file buffer
that is provided.
Syntax analysis is performed to ensure proper structure.

Phase 2: Parser
AST generation and IR generation. 
Symbol table lookups are performaed as well as error handling here before reaching any optimization
or code generation phases.
A stack machine has been tested for this use case with another
project. I am looking to test the performance in this stage extensively before moving forward.

Phase 3: Code Generation
Looking to handle code generation myself for x86_64. Might look to port with LLVM or another toolchain in
the future. TBD

About

a stepping stone for compiler frontends

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published