-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHello.py
More file actions
39 lines (34 loc) · 1.25 KB
/
Copy pathHello.py
File metadata and controls
39 lines (34 loc) · 1.25 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Welcome to the THU Compilers Sample Code Repository
清华大学编译原理课程 —— 样本代码仓库
本仓库基于龙书 (Dragon Book) + Appel 体系构建
包含词法/语法/语义分析、IR、代码生成、优化等 Python 实现
Part I 前端 (01-03): 词法分析/语法分析/AST
Part II 语义 (04-06): 语义分析/类型检查/中间表示
Part III 后端 (07-09): 代码生成/优化/运行时
Part IV 高级 (10-12): JIT/静态分析/迷你编译器
运行: python3 filename.py
"""
def main():
print("=" * 48)
print(" THU Compilers Repo")
print(" 清华大学编译原理课程样本代码仓库")
print("=" * 48)
print()
print("Based on:")
print(" Aho, Lam, Sethi, Ullman:")
print(" <<Compilers: Principles, Techniques, and Tools>>")
print(" (The Dragon Book), 2nd Edition")
print()
print(" Andrew Appel:")
print(" <<Modern Compiler Implementation>>")
print()
print("12 Chapters in Python:")
print(" Part I (01-03): Frontend")
print(" Part II (04-06): Semantic Analysis")
print(" Part III (07-09): Backend")
print(" Part IV (10-12): Advanced")
print()
print("Navigate to each chapter folder for sample code.")
if __name__ == "__main__":
main()