A Compiler for Klein

CS 4550
Translation of Programming Languages
Fall Semester 2017

[ Source Language | Target Language | Project Modules | Project Teams ]

Source Language

Your compiler will take as input programs written in Klein, a language created for this course. Here is the language specification for Klein. Know it well!

Here is a directory of Klein programs that you can use to exercise the stages of your compiler. You can also download a compressed file containing the same directory and programs. (last update: 2017/10/09 -- fixed public-private.kln (bad comment) and modified a few of the test programs for Project 2)

Two notes:

I will add files to this set over time. Please send me any interesting Klein programs that you write!

Target Language

Your compiler will generate as output programs written in the assembly language of TM, the Tiny Machine created by Kenneth Louden. Here is the machine specification for TM and its assembly language.

By convention, .tm is the standard extension for TM source files.

You can download a software implementation of TM either as a tarred, gzipped file or as individual files from this directory. (last update: 2015/11/18 -- fixed bug in simulator interface).

The directory contains four C programs, which ar a sequence of TM simulators:

It also contains two versions of a sample TM program from Louden's text.

Project Modules

You will build your compiler in phases. Links are added as modules are assigned. (The dates are tentative. We may modify them as we proceed through the semester.)

  1. scanner -- due Friday, September 15
  2. parser, step 1 -- due Friday, September 29
  3. parser, step 2 -- due Friday, October 13
  4. semantic checker -- due Friday, October 27
  5. code generator, step 1 -- due Friday, November 10
  6. code generator, step 2 -- due Friday, December 1

Your six deliverables for the project will consist of a single project directory that you grow over the course of the semester.

Your compiler may contain only code written by you, by one of your teammates, or by a program that you write. It should contain no code written by any other person or generated by any program that you did not write.

Project Teams

Based on the information you provided me, I have created the following teams (old names):

The individuals marked by a * are the team captains.

Here are some management tips that you can use to organize and run your project. Note that each team is required to select a team leader, or captain, who will serve as the primary contact for the team.

Eugene Wallingford ..... wallingf@cs.uni.edu ..... October 13, 2017