Department of Computer Science
CSU Stanislaus
California State University
CS4300-001:
Compiler Theory
Fall 2022
Instructor: Dr. Xuejun Liang
My Office: DBH 282
Office Hours: MWF 1:00 p.m. - 2:00 p.m.
Phone : (209) 667-3169, Email: xliang@cs.csustan.edu
Class Information:
Classroom: DBH 103
Class Date & Time: 2:00 p.m. – 3:15 p.m.
Class Website: https://www.cs.csustan.edu/~xliang/Courses2/CS4300-22F
Class
Server: wozniak.csustan.edu (You can use PuTTY to remote login.)
Course Materials
Required Textbook
Compilers: Principles, Techniques, & Tools, 2/E, by Alfred V. Aho, Monica S. Lam, Ravi Sethi and Jeffrey D. Ullman, Addison Wesley, 2007. ISBN: 9-780-321-486-813
Computer Accounts for Programming Assignments
Check your account here (Accounts)
Reference Textbooks
1. Compiler Construction: Principles and Practice, by Kenneth C. Louden, PWS Publishing Company, 1997
2.
flex & bison: Text
Processing Tools, by John Levine, O'Reilly Media, Inc., 2009
3.
Modern Compiler
Implementation in Java, 2/E, by Andrew W. Appel and Jens Palsberg,
Cambridge University Press, 2002
4.
Modern Compiler
Implementation in C, by Andrew W. Appel and Maia Ginsburg, Cambridge University
Press, 2004
5.
Advanced Compiler
Design and Implementation, by Muchnick Steven, Morgan
Kaufmann, 2008
6.
Engineering a
Compiler, 2nd Edition, by Keith Cooper and Linda Torczon,
Addison Wesley, 2011
Handouts
Reference Materials
Lecture Slides with the Textbook
2. Chapter 2: A Simple Syntax-Directed Translator
3.
Chapter 3: Lexical
Analysis
4.
Chapter 4: Syntax
Analysis (a)
5.
Chapter 4: Syntax
Analysis (b)
6.
Chapter 4: Syntax
Analysis (c)
7.
Chapter 5:
Syntax-Directed Translation (a)
8.
Chapter 5:
Syntax-Directed Translation (b)
9.
Chapter 6:
Intermediate-Code Generation (a)
10.
Chapter 6:
Intermediate-Code Generation (b)
11.
Cool 1
New Lecture Slides with the Textbook
1. Chapter 1: Introduction (A)
2. Chapter 2: A Simple Syntax-Directed Translator (A, B, C, D)
3. Chapter 3: Lexical Analysis (A, B, C, D)
4. Chapter 4: Syntax Analysis (A, B, C, D, E, F, G, H)
5. Chapter 5: Syntax-Directed Translation (A, B, C, D)
Course Syllabus and Major Topics
Course
Description
This course is
an introduction to the major methods used in compiler implementation. The
parsing methods of LL(k) and LR(k) are covered as well as finite state methods
for lexical analysis, symbol table construction, internal forms for a program,
run time storage management for block structured languages, and an introduction
to code optimization.
Course Outcomes
Students who successfully complete the course should be able to
1. Build a compiler for a (simplified) programming language
2. Know how to use compiler construction tools, such as generators of scanners and parsers
3. Use and apply algorithms for lexical analysis
4. Write and apply LL(1), LR(1), and LALR(1) grammars
5. Pick an intermediate representation, translate expressions, and check types.
7. Know how the code generator perform instruction selection, register allocation and assignment, and instruction ordering