A compiler for SUSTech Programming Language(SPL), a C-like custom programming language.
Project for CS323 Compilers, SUSTech.
This project is developed in 4 phases. For more details, please check the reports:
-
Phase 1: Lexical and Syntax Analyzer(102/100)
A parser for SPL that generates parse trees and reports lexical/syntax errors.
-
Phase 2: Semantic Analyzer(98/100)
A semantic analyzer for SPL, introducing the symbol table and features including type checking.
-
Phase 3: Intermediate Code Generator(99/100)
An intermediate code generator, compile the SPL code into intermediate code which could be run with IR simulator
-
Phase 4: Target Code Generator(100/100)
A target code generator, translating the intermediate code into MIPS32 code.
Tool | Version |
---|---|
C | C99 |
GNU Bison | 3.0.4+ |
Flex | 2.6.4 |
For usage guide of each phase, please refer to the How to Run section in the corresponding report.