Course Objectives: make students deeply understand how a computer program is executed by a computer; what happen in the language translation or interpretation; what is syntax or semantics analysis. By compiler construction, we hope that students can write more efficient and effective programs and understand the computer science better.
Course Requirements: The course study should be organized in the way of lecturing as well as discussion by groups. And students need to attend class and finish homework on time.
Course Contents:
1. Introduction: the translation process; data structures in a compiler
2. Scanning: regular expressions; finite automata; from regular expressions to DFAs
3. Context-free grammars and parsing: context-free grammars; parse trees; formal properties of context-free languages
4. Top-down parsing: top-down parsing by recursive descent; LL(1) parsing; first and follow sets
5. Bottom-up parsing: finite automata of LR(0) items and LR(0) parsing; SLR(1) parsing; General LR(1) and LALR(1) parsing
6. Semantic parsing: attribute grammars; algorithms for attribute computation; the symbol table; data types and type checking
7. Run-time environments: fully static runtime environments; stack-based runtime; dynamic memory; parameter passing mechanisms
8. Code generation: intermediate code and data structures for code generation; code generation of data structure references; code generation of control statements and logical expressions; code generation of procedure and function calls.
Credits: 2