-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
26 lines (20 loc) · 983 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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