In this course we learn how to design and implement a compiler for a new programming language.
Main topics are as follows:
-Week #1 and #2: Basic concepts: compiled languages vs interpreted languages, architecture of a compiler, one-pass vs multi-pass compilers.
-Week #3 and #4: Lexical Analysis: Regular languages, DFA and NFA generation, Implementing a DFA, Ordinary tokens and their patterns, Automatic Lexical analyzer generation with Flex.
-Week #5 and #6: Syntax Analysis, Top-Down Parsers, Recursive Descent Parsers, LL(k) Parsers, Implementation.
-Week #7, #8 and #9: Syntax Analysis, Buttom-up Parsers, LR(k): LR(0), SLR(1), CLR(1) and LALR(1), LR(k) vs. LL(k) parsers, Automatic Parser Generation with YACC.
-Week #10 and #11: Semantic Analysis: Attributed Grammar, Syntax-driven Definition, Annotated Parse Tree, Top-Down Parsing and Semantic Analysis.
-Week #12 and #13: Code Generation: Intermediate Code (3-argument representation), Semantic Stack, Buttom-up Parsing and Code generation. Stack and Function Call Convention.
-Week #14 and #15: Optimization, Intermediate Code Optimization, Control Flow and Data Flow Diagrams, Machine Code Optimization.
-Week #16: Misc. Lectures: Such as Garbage Collection, Security Analysis, etc.