CS 480 Translators (Compilers and Interpreters)
School of Electrical Engineering and Computer Science
Oregon State University
Corvallis, OR 97331
Instructor: Liang Huang (KEC 2069)
Class Time: MWF 12-12:50pm, Location: KIDD 350
TAs: Kai Zhao, James Cross,
and Dezhong Deng (KEC 4130).
Office Hours (tentative):
TAs: M 5-6pm, W 4-5pm, Th 5:30-6:30pm, F 3-3:50pm (KEC 4th-floor lounge).
Liang: T 2:30-3:20pm, Th 10-10:50am.
We use Canvas
for discussions and grades.
For technical questions (e.g., HW), first check if the same question has been asked on Canvas;
if not, ask it there (we monitor the discussions).
You will be rewarded for answering questions on Canvas.
For non-technical questions (e.g., grading), email email@example.com
which will reach the three of us.
In a Nutshell
An introduction to compilers; attribute grammars, syntax-directed translation, lex, yacc, LL(k) and LR(k) parsers, symbol tables, semantic analysis, and peep-hole optimization.
PREREQS: (CS 344 [C] or CS 311 [C] ) and CS 321 [C]
Like many other professors, I'm morally opposed to the way textbooks are priced.
Main textbook (recommended but not required; this course is self-contained):
- Sipser, 3rd Edition, esp. Section 2.5 (Deterministic Context-Free Grammars and Theory of Deterministic Parsing).
Similar Courses and MOOCs:
Learning Objectives of the Course:
- Describe the various phases of a compiler
- Use regular expressions and context free languages to define a language syntax.
- Create a grammar for a simple context free language
- Implement a lexical analyzer to recognize tokens defined by regular expressions
- Implement a parser, using either top down (recursive descent) or bottom up (LR) techniques
- Generate working target language for simple programming constructs.
- Five Programming Assignments (8% x 5 = 40%):
(tentatively) out on weeks 1, 2, 3, 5, 6
- Two Midterms (10% + 15% = 25%): around weeks 5 and 8
- One non-programming homework (5%)
- One Quiz (5%): will be announced two days ahead of time
- Final Project (20%) -- in groups of three
- Class Participation (5%) -- both in class and on canvas; helping your peers will be rewarded.
Instead of using gforth or variants of Java (such as Cool), we will be compiling a successively larger subset of Python into C, using Python, following Prof. Siek at Indiana.
Yes, both the source language and the language of implemention must be Python.
Basic familiarity with Python and C is assumed.
Mark2tex: compiling an extended markdown language (with maths) into LaTeX, making the latter much easier to use. You will need to define the superset of Markdown language yourself.
Must be implemented in Python as well.
In groups of three.
NO FINAL EXAM.
Please note that all homework (except the final project, which is done in groups) should
be your own individual work. Any collaboration that requires written
communication is forbidden. You should also not copy
answers from books or internet resources.
You are encouraged to study together and discuss general strategies for
solving problems but not at the level of written solutions.
Please read the
department's academic dishonesty policy for more details.
You should not use any web sources for answering the homework
questions unless explicitly instructed to do so.