banner
DIYgod

Hi, DIYgod

写代码是热爱,写到世界充满爱!
github
twitter
follow
bilibili
telegram
email
steam
playstation
nintendo switch

Implementation of a complete compiler.

Turing gives birth to machines, machines give birth to assembly, assembly gives birth to C, C gives birth to everything
(from Zhihu user Joy Neop)

This series will demonstrate the implementation process of a complete compiler from scratch.

The goal is to translate an incomplete subset of the C language into x86 assembly language, with the help of tools such as Lex Yacc and LLVM. Additionally, garbage collection and object-oriented programming will be implemented.

All the code is hosted on GitHub. The source code for each stage can be viewed here.

The main reference is the "Tiger Book" ("Modern Compiler Implementation in C"), and based on this book, the implementation is divided into 11 stages: lexical analysis, syntax analysis, semantic actions, semantic analysis, stack frame layout, translation, normalization, instruction selection, control flow analysis, data flow analysis, register allocation, and code emission.

Completed stages:

"Implementation of a Complete Compiler - Lexical Analysis | Anotherhome"

"Implementation of a Complete Compiler - Syntax Analysis | Anotherhome"

To be continued...

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.