The final programming assignment (IR generation) is out and is due on Saturday, August 18 at 11:30 AM (note the time change). Once you've completed this assignment, you'll have a full working compiler for Decaf. Isn't that cool?
As a logistical note, be aware that there will be no late submissions allowed for this assignment. The due date for pp4 is the latest possible time that we can have assignments due, so please try to get it in on time.
Windows starter code for pp3 is now available. If you have done pp1 and pp2 on Windows, you should be all set to go. Otherwise, you will need to follow the setup instructions for those assignments before proceeding to ensure that the appropriate tools are installed on your system.
The third programming assignment (semantic analysis) goes out today. This assignment is broken into two portions - a checkpoint assignment due on Monday, July 30 at 11:59PM (hard deadline), and the main assignment, which is due on Monday, August 6 at 11:59PM. In this assignment, you will perform the final set of checks necessary to confirm that the input program is indeed well-formed, setting the stage for IR generation in the next assignment.
This assignment is substantially larger than the previous assignments, so be sure to start early.
The CS143 midterm exam is next Wednesday, July 25, from 11:00AM - 1:00PM. We'll meet in the normal room (Thornton 102). The exam covers the material up to and including Earley parsing, with an emphasis on scanning, LL, and LR parsing. The exam is open-book, open-note, open-computer, but closed-network, meaning that you can have the slides and other notes available during the exam. You just can't go Googling the answers.
There is a practice exam available, which is the exam that was given last summer quarter. The structure and content of this exam is similar to that of the upcoming exam.
If you are taking this class remotely, you will receive an electronic copy of the exam at around 11:00AM on July 25 and can start taking the exam any time between 11:00AM on July 25 and 11:00AM on July 26. You should return the exam to us no later than 1:00PM on July 26, and we'll include submission instructions along with the exam itself.
There will be a review session on Monday, so please feel free to show up with questions!
Windows starter files for the second programming project are now available. To use them, you will need to follow these instructions:
If you do your development work in Windows, you will still need to submit using the existing submissions framework.
Hope this helps!
The second written assignment is out and comes due next Wednesday, July 18 at 5:00PM. This will give you a chance to explore the strengths, weaknesses, and nuances of the parsing algorithms we've developed over the past few weeks.
Programming Assignment 2 (Syntax Analysis) goes out today. It's due on Friday, July 20 at 11:59PM. In this assignment, you will build up the parser for Decaf, and will learn how to use the bison tool in the process. Additionally, you will get experience introducing new features into the language as you add switch statements and a few other extensions to Decaf.
We will be releasing a Windows version of this assignment later today once we've confirmed that our starter project files work correctly.
Several of you have asked how to log in to the Stanford machines remotely. To do so, you will need an SSH client. On Linux or Mac computers, you can do this from the command-line with ssh. On Windows, you will need to download a SSH client such as PuTTY or SecureCRT (available with your SUNetID here). From there, you will want to connect to either myth.stanford.edu or corn.stanford.edu. You will probably get a warning about a RSA key not matching, which is perfectly fine; these above hostnames will forward you to a free machine on the cluster. From there, you should be good to go!
If you're having trouble logging in, or if you have any other questions, as always feel free to contact us.
Hope this helps!
Please use Piazza to ask and discuss questions.
We have scheduled our office hours as following:
The first written assignment is out and comes due next Friday, July 6 at 5:00PM. This problem set explores the theoretical aspects of scanning, and will ask you to play around with the different algorithms we explored in lecture.
As an experiment this quarter, we've put together Windows starter files for the first programming assignment. To use these starter files, follow these steps:
If you do your development work in Windows, you will still need to submit using the existing submissions framework. I'll get directions on how to do this posted later.
Hope this helps!
Programming Assignment 1 (lexical analysis) goes out today. It's due on Monday, July 9 at 11:59PM. This assignment asks you to build the very first piece of the Decaf compiler. In doing so, you'll learn about the flex tool, and will master regular expressions. You have plenty of time to complete this assignment, but I would strongly suggest starting early.
Welcome to CS143, Stanford's course in the practical and theoretical aspects of compiler construction. We have an exciting quarter ahead of us loaded with that wonderful combination of concepts and coding that makes compilers so cool. Class meets Monday/Wednesday/Friday in Thornton 102 from 11:00AM - 12:15PM, and I hope that you're able to join.
In the meantime, feel free to check out the course information handout to learn more about what this class is all about, the prerequisites, and the course policies. If you have any questions in the meantime, feel free to email me at firstname.lastname@example.org.
00: Course Information
02: Course Overview
03: Decaf Specification
04: Lexical Analysis
05: flex in a Nutshell
06: Programming Assignment 1
07: Written Assignment 1
07S: Written Assignment 1 Solutions
08: Formal Grammars
09: Top-Down Parsing
10: Bottom-Up Parsing
11: LR and SLR Parsing
12: Introducing bison
13: Programming Assignment 2
14: LALR Parsing
15: Miscellaneous Parsing
16: Syntax-Directed Translation
17: Written Assignment 2
17S: Written Assignment 2 Solutions
18: Semantic Analysis
19: Programming Assignment 3
20: Practice CS143 Midterm
20S: Practice CS143 Midterm Solutions
21: CS143 Midterm
21S: CS143 Midterm Solutions
22: Runtime Environments
23: Intermediate Representations
24: Three-Address Code Examples
25: Programming Assignment 4
Flex Online Manual
Bison Online Manual
SPIM Simulator Documentation
CS1U: Practical Unix Videos
Unix Reference Documentation
xemacs Command Reference
vi Command Reference
gdb Command Reference
cplusplus.com C++ Reference
CS106L Course Reader (C++ Reference)
Fall 2010 CS143 Page
00: Intro to Compilers
01: Lexical Analysis
02: Syntax Analysis
03: Top-Down Parsing, Part I
04A: Top-Down Parsing, Part II
04B: Bottom-Up Parsing, Part I
05: Bottom-Up Parsing, Part II
06: Bottom-Up Parsing, Part III
07: Advanced Parsing
08: Semantic Analysis
09: Type-Checking, Part I
10: Type-Checking, Part II
11: Runtime Environments, Part I
12: Runtime Environments, Part II
14: Local Optimization
15: Global Optimization, Part I
16: Global Optimization, Part II
17: Register Allocation
18: Garbage Collection
19: Code Optimization