Schedule

Fall, 2019

The "6in1" versions below are condensed for efficient printing.

In general, try to complete the "Readings" for a given lecture before the lecture.
Get homework information from the Homework page and .


ch1 | ch2 | ch3 | TA1 | ch4 | ch5 | ch6 | TA2 | ch7 | ch8 | TA3 | ch9 | ch11&12

Lecture Date Subject and Slides Readings
#1 Mon, Sep.2 Course Introduction
Course Info( 6in1), Introduction( 6in1)
Book Chapter 1
#1
#2
#3
#5
Mon, Sep.2
Wed, Sep.4
Mon, Sep.9
Mon, Sep.16
Lexical analysis (6in1)
  • Lexer and tokens
  • Specification of tokens:regular expressions and definitions)
  • Recognition of tokens: transition diagrams
  • Finite automata: NFA→DFA: subset construction (ε-closure), minimize the number of states of a DFA
  • Regular expression → NFA
  • A lexical analyzer generator: Flex
  • Book Chapter 2
    ANTLR(slides)
    Flex
    #4
    #6
    #7
    #8
    #9
    Wed, Sep.11
    Wed, Sep.18
    Mon, Sep.23
    Wed, Sep.25
    Mon, Sep.30
    Syntax analysis (6in1)
  • Context-free grammars: (terminals, nonterminals, a start symbol, productions), derivations, parse trees, ambiguity
  • Writing a grammar: lexical vs. syntactic analysis, verifying the language generated by a grammar, eliminating ambiguity, eliminating left recursion, left factoring, non-context-free lang. constructs,
  • Top-down parsing: recursive-descent parsing, LL(1),LL(*)
    First(α), Follow(A), parsing table, nonrecursive predictive parsing, error recovery
  • Bottom-up parsing: handle, shift-reduce parsing, shift/reduce or reduce/reduce conflicts
  • LR parsing: viable prefix, configuration, action[s, a]: shift | reduce | accept | error, goto[s, A]->s
  • Top-down parsing vs. Shift-reduce parsing vs. LR parsing
  • Constructing LR parsing tables: SLR(1), LR(1), LALR(1)
  • Using ambiguous grammars: precedence and associativity, error recovery
  • Parser generator: Yacc, ANTLR
  • Book §3.1~3.7
    ANTLR
    Bison
    #TA1 Thu, Sep 25 TA's class: homework, practice
    #10
    #11
    #12
    Wed, Oct 9
    Mon, Oct 14
    Wed, Oct 16
    Syntax-directed translation (6in1)
  • Syntax-directed definitions: synthesis and inherited attributes, dependence graph, ordering the evaluation of attributes
  • Syntax tree and its construction
  • S-attributed definitions and L-attributed definitions
  • Top-down translation
  • Bottom-up evaluation
  • Book §4.1~4.4;
    ANTLR
    Bison
    MidEx Thu, Oct 20 Midterm Exam (1.5h): Ch1~Ch4; 9:00-10:30, 3A110
    #12
    #13
    #14
    #15
    Wed, Oct 16
    Mon, Oct 21
    Wed, Oct 23
    Mon, Oct 28
    Type checking (6in1)
  • The functionality of type: trapped/untrapped/forbidden error; well-behaved program, safe language; typed language, type system(typing rule), type checking, well-typed program
  • Formalization of type systems: typing assertion, typing rules, type inference/checking
  • Specification of a simple type checker
  • Polymorphic functions: type variables, substitution, unify
  • Equivalence between type expressions: structural equivalence, name equivalence
  • Function/operator overloading
  • Book Chapter 5;
    #15
    #16
    #17
    #18
    #19
    Mon, Oct 28
    Wed, Oct 30
    Mon, Nov 4
    Wed, Nov 7
    Mon, Nov 11
    Runtime storage organization (6in1), examples (6in1)
  • Storage layout for local names: scope, lifetime, activation record, alignment
  • Stack allocation of space: activation tree, calling/return sequences, variable-length data on the stack, dangling pointer
  • Access to nonlocal data: data access without nested procedures; issues with nested procedures - nesting depth, access links; static/dynamic scope
  • Parameter transfer: call by value/reference/name
  • Heap management: memory manager, memory hierarchy, locality, manual deallocation requests
  • Book Chapter 6;Stack overflow
    #TA2 Sat, Nov. 16 TA's class:homework, project
    #20
    #21
    #22
    Wed, Nov 13
    Mon, Nov 18
    Wed, Nov 20
    Intermediate Representation and Generation (6in1)
  • DotNet Intermediate Representation and Generation (6in1)
  • Compiler for Machine Learning (6in1)
  • Book Chapter 7, 8.3;
    LLVM IR,
    LLVM Programmer’s Manual
    and LLVM Tutorial
    #23
    #24
    Mon, Nov 25
    Wed, Nov 27
    Code Generation (6in1) Book Chapter 8;gcc对整型和实型参数传递的处理特点分析
    #TA3 Wed, Dec. 4 TA's class:H7 and Midterm, Lab1-2, Lab1-3 and Lab2-1
    #26
    #27
    #28
    Mon, Dec 2
    Wed, Dec 4
    Mon, Dec 9
    Optimization (6in1) Book Chapter 9;
    #29 Wed, Dec 11 Compiler and Runtime System (6in1) Book Chapter 11, 12;
    Final Wed, Dec 25 Final Exam Ch4~Ch12; 9:45-11:20, 3A113