CS160: Translation of Programming Languages
A compiler is a computer program that translates text (code) written in one language (the source language) into another language (the target language). In this course, we will study the structure and the different tasks of a compiler. This includes lexical analysis (scanning), syntax analysis (parsing), semantic analysis and type checking, and code generation. The goal is to understand the complete process: from reading the source program, checking whether it conforms to the rules of the language, and producing output that a machine can understand.
We will use the following (optional) text book for the class: Engineering a Compiler (3rd edition), by Keith D. Cooper and Linda Torczon, Morgan Kaufmann. Please note that the lecture notes are important and complement the material in the book (in other words, the book itself is not sufficient).
For the projects, we will use compiler-generator tools (such as lex and yacc) to develop the front-end for our compiler. Then, we will use custom data structures (abstract syntax tree, symbol tables) to analyze the semantics of the program. Finally, we will develop a code generator to write out the appropriate machine instructions. For more details on the project schedule, please see the projects' pages (made available over the course of the class).
The grading for 160 will come from two exams (midterm and final) and a number of programming projects. For these programming projects, you will build a working compiler that takes a simplified version of C as input and produces executable machine code.
Project Submission and Late Policy
Project assignments are due at 11:59:59PM on the night it is due. For details on how to submit your assignments, you should read the project pages.
Policy on Cheating and Plagiarism
A note on cheating. We encourage you to talk with your classmates and discuss your approaches on projects, but any actual copying of code is cheating. Cheating will result in a 0 on the assignment, and depending on severity, can result in a failing grade or possible administrative action by UCSB.