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:
Labs:
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.
Automatic Generation of MiniJava Parser
JavaCC lookahead
MiniJava Expressions
MiniJava AST
The Visitor Design Pattern
MiniJava Visitor Design Pattern
Domain Analysis
Type Checking
Class Disassembly
Class Generation
Lab Assignments on AI compilers
If you would like to work on an AI compiler please follow this
link.
Lab Activity
Bibliography
- Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman - Compilers, Principles, Techniques and Tools, Addison-Wesley, 1986

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

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