Compilers¶
- this note is made by BoxuanHu in Spring 2024
- the main topic is "Compilers"
事实上这门课的深入学习需要三个方面齐同协进
- 知识提纲梳理
- 知识的“书面推导与运用”
- 代码设计与构造逻辑
这篇笔记聚焦于 知识提纲梳理,书面推导与运用见笔者仓库对应部分,代码设计见NJU课程官网实验解析
Compilers¶
This course is taught by Prof. Hengfeng Wei @NJU
课程设计
- 教材:Compilers: Principles, Techniques, and Tools (大名鼎鼎的“龙书”)
- 内容:理论部分基本按照龙书节奏叙述。包括词法分析、语法分析、语义分析、运行时环境、寄存器分配、代码优化与生成等内容
- 特点:选用了当下热门的 ANTLR (ANother Tool for Language Recognition) v4 编程语言解析生成工具辅助教学,能让使用者专心词法或者语法分析的设计
课程配套
- Course Homepage: NJU-Compilers-Spring-2024
- Piazza: NJU-Compilers-Chatting
- Course Online: Bilibili-NJU-Compilers-Spring-2024
Appendix¶
Reference:
- Berkeley: CS164 - Programming Languages and Compilers,
- CMU: 15411 - Compiler Design ( F09, F11, F15)
- MIT: 6.036 - Computer Language Engineering
- Stanford: CS143 - Compilers
Compiler Generator¶
- Generating Lexer: Flex (for windows), JFlex(link1, link2)
Grammar-Lex Spec.:ANSI-C - Generating Parser: Bison (for windows), Java CUP, JavaCC, ANTLR (Why use ANTLR)
Grammar: ANSI-C
Compilers¶
- Compiler Explorer
- LCC: lcc-win, paper, book
- GCC: GNU GCC, MinGW
- LLVM: llvm.org, clang, MLIR, CIRCT,
Getting Started with LLVM Core Libraries
ASM¶
- The Art of Assembly Language, LinuxASM
- HLA
- Assemblers: The GNU Assembler, NASM
XML¶
Architectures¶
- ACPI( spec50)
- IA32: IA-32 Intel Architecture Software Developer’s Manual
- AMD64: AMD Developer Guides and Manuals: V1: Application Programming, V2: System Programming, V3: General Purpose and System Instructions, V4: 128-bit and 256 bit media instructions, V5: 64-Bit Media and x87 Floating-Point Instructions.
- MIPS: SPIM, See MIPS Run, MIPS32/64 Archtecture for Programmers
Others¶
- BBS: Compiler, CSArch(ftp), ASM, Java
- The Programming Language and Compiler Research Home Page.
- Browse comp.compilers or comp.lang.ml newsgroups.