Compiler Design Lectures & Labs - 1 MSE

| Description | Syllabus | Timetable | Lectures | Exams | Lab assignments | Lab activity | Bibliography |

Description

The lectures are about basic compiling techniques presented in the black dragon book. In the laboratory of this course we will implement a compiler for an object-oriented language called MiniJava. The compiler will be built using the JavaCC parser generator. The semantical analysis is based on the Visitor design pattern. Finally, the parser will generate Java byte code following the Java virtual machine specification.

Syllabus

News

  • AI compilers article link
  • AI compilers are similar to programming language compilers in terms of design, transformation, and optimization. Some similar ideas make AI compilers a broad field. And then their optimizations and designs can be more sophisticated, flexible, scalable, and efficient. For example, Google introduced composable and modular code generation in MLIR with a structured and retargetable approach to tensor compiler construction.
  • AI/ML compilation is uniquely essential to accelerate training and serving. All these can be orchestrated by AI engineering for comprehensive efficiency with engineering principles.

Timetable

Lectures:

  • Monday 08:00-10:00 A305

Labs:

  • Monday 10:00-12:00 A305

Lectures

0100. Introduction Overview pdf

0101. Introduction pdf

0300. Lexical Analysis Overview pdf

0301. The Role of the Lexical Analyzer pdf

0302. Input Buffering pdf

0303. Specification of Tokens pdf

0305. The Lexical Analyzer Generator Lex pdf

0306. Finite Automata pdf

0307. From Regular Expression to Automata pdf

0308. Design of a Lexical Analyzer Generator pdf

0309. Optimization of a DFA-based Pattern Matchers pdf

0310. Summary pdf

0400. Syntax Analysis Overview pdf

0401. Introdution pdf

0402. Context-Free Grammars pdf

0403. Writing a Grammar pdf

0404. Top-Down Parsing pdf

0405. Bottom-Up Parsing pdf

0406. Introduction to LR Parsing pdf

video recordings user upt pass upt

Exam Results

Lab Assignments on a JavaCC based compiler

For the laboratory works you can select between creating a classic compiler and an AI compiler study.
  1. Automatic Generation of MiniJava Parser

  2. JavaCC lookahead

  3. MiniJava Expressions

  4. MiniJava AST

  5. The Visitor Design Pattern

  6. MiniJava Visitor Design Pattern

  7. Domain Analysis

  8. Type Checking

  9. Class Disassembly

  10. Class Generation

Lab Assignments on AI compilers

If you would like to work on an AI compiler please follow this link.

Lab Activity

Bibliography

  1. Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman - Compilers, Principles, Techniques and Tools, Addison-Wesley, 1986

  2. Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman - Compilers, Principles, Techniques and Tools, Second Edition, Pearson Education, 2006

  3. Erich Gamma, Richard Helm, Ralph Johnson, John M. Vlissides - Design Patterns: Elements of Reusable Object-Oriented Software, 1995.
  4. Oracle Corporation - JavaCC Parser Generator, http://java.net/projects/javacc/downloads
  5. Tim Lindholm, Frank Yellin - The Java Virtual Machine Specification, Second Edition.