CS160: Translation of Programming Languages

Introduction


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 text book for the class: Engineering a Compiler, by Keith D. Cooper and Linda Torczon, Morgan Kaufmann. Here is a link to the errata page. 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.

News


  • To prepare for the final, here is a previous exam.
  • Date and Location for the FINAL: Friday, 19. March 2010: 1200-300, 387 104
  • Practice sheet 3 released
  • Deadline extended: Project 4: New deadline is Wed., Mar. 10, 23:59:59 PST.
  • Project 5 released. Deadline is Fri, Mar. 19, 23:59:59 PST.
  • No class on Monday, Mar. 01
  • Deadline extended: Project 3: New deadline is Fri., Feb. 26, 23:59:59 PST.
  • Project 4 released. Deadline is Tue, Mar. 09, 23:59:59 PST.
  • Project 3 released. Deadline is Thu, Feb. 25, 23:59:59 PST.
  • Project 2 released. Deadline is Fri, Feb. 12, 23:59:59 PST.
  • MIDTERM: Wednesday, February 10, 2010; in class (11:00 - 12:15)
  • Practice sheet 2 released
  • Project 1 released. Deadline is Mon, Feb. 1, 23:59:59 PST.
  • Makeup class: Tuesday, Feb. 19: 9am - 10am: HFH 1132
  • Practice sheet 1 released

General Information


Lectures:Mon/Wed, 11:00AM - 12:15PM387 104
Discussion:Tue, 05:00PM - 05:50PM387 104
Instructor:Christopher Kruegelchris (at) cs.ucsb.edu
Office hours:Wed, 01:30PM - 02:30PMHarold Frank Hall 1117
TAHeba Saadeldeenheba (at) cs.ucsb.edu
Office/Lab hours:Tue/Thu, 11:30AM - 1:30PMCSIL Lab
Wed, 01:30PM - 2:30PMCSIL Lab
Mailing lists:Instructor/TAcs160admin@lists.cs.ucsb.edu
Classcs160@lists.cs.ucsb.edu

Grading Policy


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.

Projects50%
Exams (Midterm and Final)50%

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.