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.

[registrar entry]

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 cs480-winter16-orst@googlegroups.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):

Other Resources:

Similar Courses and MOOCs:

Learning Objectives of the Course:

  1. Describe the various phases of a compiler
  2. Use regular expressions and context free languages to define a language syntax.
  3. Create a grammar for a simple context free language
  4. Implement a lexical analyzer to recognize tokens defined by regular expressions
  5. Implement a parser, using either top down (recursive descent) or bottom up (LR) techniques
  6. Generate working target language for simple programming constructs.

Assessment (tentative)

Programming Assignments

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.

Final Project

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.


Important Note: 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.

Liang Huang