Course Description
Design and construction of compilers including lexical analysis; parsing techniques such as LL(1), LR, and LALR(1) code generation techniques. Error analysis and simple code optimizations will be introduced. A large-scale project consisting of developing a lexical analyzer, parser, abstract syntax tree, symbol table, activation code, and intermediate code generation, and finally generating assembly code will be implemented.
Students will design and implement a compiler using standard UNIX-based compiler tools for a small but representative language.
- Fulfills Undergraduate CSC Large-Scale Complex Course Requirement
- CSC 416 Prerequisites: CSC 220, 240, 241, {CSC231 or CSC242}
CSC 565 Prerequisites: CSC 520, CSC530
By the end of the course, students will attain the following:
- understand the phases of a compiler.
- utilize modern tools to perform the lexing and parsing phases of a compiler’s front-end.
- understand the theoretical concepts of LL(1) and LR(1) parsing.
- understand the back-end phases of a compiler, including: intermediate representations, runtime organization, optimization, and code generation.
- implement a compiler that spans from the lexical front-end to code generation in the back-end.
Instructor and Office Hours

I am Dr. Richard Burns, Professor in the Computer Science Department. My research interests include artificial intelligence and machine learning. I started teaching this course around 10 years ago. It's fun and interesting to teach, and still very relevant in modern day computing.
Office Hours
- Mondays: 2p-3p (virtual only)
- Tuesdays: 4p-5p (in-person or virtual)
- Wednesdays: 12p-1p (in-person or virtual)
- Thursdays: 1p-2p (in-person or virtual)
- Must schedule appointment at least 12 hours in advance via Microsoft Bookings. Virtual meeting Room instructions will be provided in confirmation email.
Email, Office, Phone
- E-mail: rburns@wcupa.edu
- Office: (25 University Ave.) UNA 150D
- Phone: 610-436-2690
Meeting Information
This course will engage in-person for all classes, unless otherwise indicated on the course schedule. Zoom information for any remote synchronous meetings can be found at: D2L Course Page > Zoom.
- Section 01: Tuesdays: 7:15p-10p, UNA 166
Resources

- (Required) Textbook: [Thain] Introduction to Compilers and Language Design, Douglas Thain, Second edition, 2021.
- CSC345 discord server (invitation link posted on D2L: D2L > Content > Overview): We will use discord for additional remote communication and collaboration (e.g. sharing work, posting conceptual questions, posting programming questions, potentially breaking out into groups for the team projects). Please post and answer your peers' questions. There is no stupid question.
- Textbook (Optional): [Appel] Modern Compiler Implementation in Java. Andrew W. Appel. 2nd Edition.
- Textbook (Optional): [Dragon] Compilers: Principles, Techniques, and Tools. Alfred Aho, Monica Lam, Ravi Sethi, and Jeffrey Ullman. Second Edition. Addison-Wesley.
- Textbook (Optional): [CaC] Crafting a Compiler, 1st Edition. Fisher, Cytron, Leblanc. Addison-Wesley. ISBN-13: 9780136067054
- Textbook (Optional): [Cooper] Engineering a Compiler. Keith Cooper and Linda Torczon. Second Edition. Morgan Kaufman.
- Textbook (Optional, free e-textbook): [Torben] Basics of Compiler Design. Torben Mogensen. 2010 Edition.
- D2L
Evaluation
- 30% - Programming Assignments
- 20% - Written Homeworks
- 20% - Midterm Exam
- 30% - Final Exam
Grade Scheme
This is the "minimum" grade scale. Usually overall course grades end up being curved higher, based on the mean and standard deviation of scores. Please see me to discuss grades rather than speculating.
CSC416 (undergraduate)
| Grade | Percentage Equivalents |
|---|---|
| A | 93-100 |
| A- | 90-92 |
| B+ | 87-89 |
| B | 83-86 |
| B- | 80-82 |
| C+ | 77-79 |
| C | 73-76 |
| C- | 70-72 |
| D+ | 67-69 |
| D | 63-66 |
| D- | 60-62 |
| F | 0-59 |
CSC565 (graduate)
| Grade | Percentage Equivalents |
|---|---|
| A | 93-100 |
| A- | 90-92 |
| B+ | 87-89 |
| B | 83-86 |
| B- | 80-82 |
| C+ | 77-79 |
| C | 73-76 |
| C- | 70-72 |
| F | 0-69 |
Other Course Policies
Other course policies (e.g. attendance, lateness, academic integrity, ... ) can be found on the syllabus, which will never change.
Course Schedule
| Class 1 |
Tues, Aug 29
In-Person
Course Introduction Structure of a Compiler [Thain] Chs. 1, 2 Class Discord invitation Link Posted on D2L: Programming Assignment 0 Out (1% of overall course grade) GitHub Classroom Assignment Invitation |
|---|---|
| Class 2 |
Tues, Sept 5
In-Person
Role of the Scanner Lexical Analysis: Lexical Tokens, Regular Languages, Lexical Specifications [Thain] Ch. 3.1-3.3 Data Structures for Tree Languages [Appel] Ch. 1 (link) Programming Assignment 1 Out (data structures for tree languages) CSC416 and CSC565:GitHub Classroom Assignment InvitationCSC565 complete this as well:GitHub Classroom Assignment Invitation |
| Class 3 |
Tues, Sept 12
In-Person
Regular Expressions into NFAs, NFAs to DFAs Scanner Generators ( [Thain] Ch. 3.4-3.8 Written Homework 1 Out HW1 Programming Assignment 0 Due (1% of overall course grade) |
| Class 4 |
Tues, Sept 19
In-Person
Role of the Parser Context Free Grammars, Derivations, Parse Trees Ambiguity, Top-Down Parsing, Recursive Descent [Thain] Ch. 4.1-4.2, 4.3.4 Programming Assignment 2 Out (the scanner) CSC416 and CSC565:GitHub Classroom Assignment Invitation |
| Class 5 |
Tues, Sept 26
In-Person
Eliminating Left Recursion, Left Factoring Predictive Parsing LL(1) Grammars, LL(1) Parsing Tables Parsing Table Construction for LL(1) grammars: [Thain] Chs. 4.3-4.6 Programming Assignment 1 Due (data structures for tree languages) Written Homework 2 Out HW2 |
| Class 6 |
Tues, Oct 3
In-Person
Bottom-Up Parsing SLR Parsing Parsing Tools Error Recovery [Thain] Ch. 4.4.1, 4.4.3 Written Homework 1 Due Programming Assignment 3 Out (the parser) CSC416 and CSC565:GitHub Classroom Assignment Invitation |
| Class 7 |
Tues, Oct 10
In-Person
Abstract Syntax Trees (AST) Semantic Actions Disambiguating Grammars for Operator Precedence Visitor Design Pattern [Thain] Ch. 5.3, 6.1 Programming Assignment 2 Due (the scanner) |
|
Tues, Oct 17
Fall Break - No class! |
|
| Class 8 |
Tues, Oct 24
In-Person
Semantic Analysis: Symbol Tables Semantic Analysis: Type Checking [Thain] Ch. 7.1-7.2, 7.4-7.7 Midterm Review, HW #1 Solutions, HW #2 Solutions Written Homework 2 Due |
| Class 9 |
Tues, Oct 31
In-Person
Midterm Exam
|
| Class 10 |
Tues, Nov 7
In-Person
Runtime Memory Organization Activation Frames [Thain] Ch. 9.1, 9.2, 9.4 Programming Assignment 3 Due (the parser) Programming Assignment 4 Out (the semantic analyzer) CSC416 and CSC565:GitHub Classroom Assignment Invitation |
| Class 11 |
Tues, Nov 14
In-Person
Assembly Language MIPS Simulator: MARS (MIPS Assembler and Runtime Simulator) Examples: [add.asm] [swap.asm] [Thain] Chs. 10.1, 10.2, 10.4 Written Homework 3 OutHW3 |
| Class 12 |
Tues, Nov 21
Remote Asynchronous (RA)
Programming Assignment 5 Introduction
Programming Assignment 5 Out (code generation) CSC416 and CSC565:GitHub Classroom Assignment Invitation |
| Class 13 |
Tues, Nov 28
In-Person
Local Optimization Global Optimization [Thain] Ch. 12.1 - 12.3 Programming Assignment 4 Due (the semantic analyzer) Written Homework 3 Due (optional) Written Homework 4 Out HW4 |
| Class 14 |
Tues, Dec 5
In-Person
Register Allocation [Thain] Ch. 12.4 - 12.5 Written Homework 4 Due (optional) |
| Finals |
Tues, Dec 12 (8:15p-10:15p ☕, in regular classroom)
In-Person
Final Exam Programming Assignment 5 Due (code generation, due Mon Dec 11) |
