[UPDATE] Update SJTU-Compiler Course (#830)

* update SJTU compilers

* update SJTU compilers (English)
This commit is contained in:
Bojun Ren
2026-01-18 19:29:55 +08:00
committed by GitHub
parent 542a7f4a9b
commit ac0cef182a
2 changed files with 22 additions and 20 deletions

View File

@@ -10,20 +10,21 @@
The Compiler Principles course at Shanghai Jiao Tong University aims to implement a compiler for the Tiger language. In this course, you will learn about lexical analysis, grammar analysis, semantic analysis, escape analysis, activation records (stack frames), LLVM IR, liveness analysis, register allocation, garbage collection, object-oriented programming, functional programming, and many other topics. Similar to the Compiler Principles course at Peking University, this course offers you a great deal of freedom. The test programs will only check the correctness of the assembly code you output and will not impose any restrictions on the specific design of your compiler. You will need to build your own compiler step by step from scratch.
In this course, you will learn how to use frameworks such as `flexc++`, `Bisonc++`, and `LLVM`, and enhance your debugging skills through practice. The theoretical part of the course is taught by teachers from the IPADS Laboratory at Shanghai Jiao Tong University.
In this course, you will learn how to use frameworks such as `Flex`, `Bison`, and `LLVM`, and enhance your debugging skills through practice. The theoretical part of the course is taught by teachers from the IPADS Laboratory at Shanghai Jiao Tong University.
## Course Resources
- Course Website: <https://ipads.se.sjtu.edu.cn/courses/compilers/index.shtml>
- Slides: See the course website
- Framework Code: <https://ipads.se.sjtu.edu.cn:2020/compilers-2024/compilers-2024> (If unable to access, you can use other similar and maintained repositories, such as <https://gitee.com/east-china-normal-university_ttb_cs/tiger-compiler-25sp>)
- Course Website: <https://ipads.se.sjtu.edu.cn/courses/compilers>
- Slides: <https://ipads.se.sjtu.edu.cn/courses/compilers/Schedule.html>
- Framework Code: Not yet open-sourced. Old version: <https://gitee.com/east-china-normal-university_ttb_cs/tiger-compiler-25sp>; For the newest version, please contact to the TA.
- Course Textbook: "Tiger Book" (Modern Compiler Implementation in C) <https://ipads.se.sjtu.edu.cn/courses/compilers/textbook/TigerBook-English.pdf>
- 2 Quizzes + 6 Labs
- 2 Quizzes + 5 essential labs + 2 optional labs
- Lab 1: Straight-line Program Interpreter
- Lab 2: Lexical Analysis
- Lab 3: Parsing
- Lab 2: Lexer
- Lab 3: Parser
- Lab 4: Type Checking
- Lab 5
- Part 1: Escape Analysis and Translation
- Part 2: Tiger Compiler without Register Allocation
- Lab 6: Register Allocation
- Part 1: Escape Analysis
- Part 2: Translate to LLVM
- (Optional) Lab 6: Code Generation
- (Optional) Lab 7: Register Allocation

View File

@@ -10,7 +10,7 @@
上海交通大学的编译原理课程旨在实现一个 Tiger 语言的编译器。在这门课上你可以学习到词法分析、文法分析、语义分析、逃逸分析、活动记录栈帧、LLVM IR、活跃分析、寄存器分配、垃圾收集、面向对象、函数式程序等众多话题。和北大的编译原理课程相似该课程给予了你极大的自由度测试程序只会对你输出的汇编代码的正确性进行测试而不会对你编译器的具体设计做任何限制。你需要从一个个空文件中一步步构建出属于你自己的编译器。
在这门课上你将学到`flexc++``Bisonc++``LLVM`等框架的使用方法,并在练习过程中加强自己的调试能力。
在这门课上你将学到 `Flex``Bison``LLVM` 等框架的使用方法,并在练习过程中加强自己的调试能力。
理论部分由上海交通大学 IPADS 实验室的老师讲述。
@@ -18,16 +18,17 @@
## 课程资源
- 课程网站:<https://ipads.se.sjtu.edu.cn/courses/compilers/index.shtml>
- 课件:参见课程网站
- 框架代码:<https://ipads.se.sjtu.edu.cn:2020/compilers-2024/compilers-2024>(如果无法打开,可以使用其他相同且正在维护的仓库,例如<https://gitee.com/east-china-normal-university_ttb_cs/tiger-compiler-25sp>
- 课程网站:<https://ipads.se.sjtu.edu.cn/courses/compilers>
- 课件:<https://ipads.se.sjtu.edu.cn/courses/compilers/Schedule.html>
- 框架代码:暂不开源,旧版本可以见 <https://gitee.com/east-china-normal-university_ttb_cs/tiger-compiler-25sp>,新版本可以邮件联系当届助教。
- 课程教材虎书Modern Compiler Implementation in C<https://ipads.se.sjtu.edu.cn/courses/compilers/textbook/TigerBook-Chinese.pdf>
- 2 次Quiz + 6 个Lab
- 2 次 Quiz + 5必做 Lab + 2 个选做 Lab
- Lab 1: Straight-line Program Interpreter
- Lab 2: Lexical Analysis
- Lab 3: Parsing
- Lab 2: Lexer
- Lab 3: Parser
- Lab 4: Type Checking
- Lab 5
- Part 1: Escape Analysis and Translation
- Part 2: Tiger Compiler without register allocation
- Lab 6: Register Allocation
- Part 1: Escape Analysis
- Part 2: Translate to LLVM
- (Optional) Lab 6: Code Generation
- (Optional) Lab 7: Register Allocation