A Compiler for Flair
Translation of Programming Languages
Fall Semester 2018
Your compiler will take as input programs written in Flair,
a language created for this course. Here is
the language specification
for Flair. Know it well!
a directory of Flair 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: 2018/09/19
-- posted test files for Project 1, plus is-special)
- By convention, .flr is the standard
extension for Flair source files. Please follow this
standard, as it allows other tools to assume the
extension as a default.
- This set of files may not be sufficient to test all of
the features of your compiler as you write it. It does
not always contain all error cases, nor does it always
provide a systematic coverage of Flair features.
- Without a Flair compiler to use as a reference, it is
possible that one or more of these programs contains
an error. As you study the Flair grammar early in the
project, use these programs to verify your understanding.
If you find a Flair program that seems to violate the
language specification, let me know immediately.
This will help us debug the grammar, the program, or your
I will add files to this set over time. Please send me any
interesting Flair programs that you write!
Your compiler will generate as output programs written in the
assembly language of TM, the Tiny Machine created by
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
(last update: 2010/08/20 -- posted the initial code).
The directory contains four C programs, which ar a sequence of
- a version essentially identical to the machine defined in
with a small change to eliminate a run-time warning.
- a version that takes command-line arguments.
- a version that executes the TM program immediately,
rather than interacting with the user through a menu.
This version of the simulator can be useful when we trust
that our compiler is correct and are most interested in
its performance (and in debugging Flair programs).
- a version that reports the number of clock ticks consumed
by program execution. This version of the simulator can
be useful in comparing implementations and optimizations.
It also contains two versions of a sample TM program from
You will build your compiler in phases. Links are added as
modules are assigned.
-- due Friday, September 14
parser, step 1
-- due Friday, September 28
parser, step 2
-- due Friday, October 12
-- due Friday, October 26
code generator, step 1
-- due Friday, November 9
code generator, step 2
-- due Friday, November 30
-- due Friday, December 7
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.
Based on the information you provided me, I have created the
The individuals marked by a * are the team captains.
- Will Code for Food: Dalal, Herng, Vijaranakorn* (language)
- Avalanche: Holzapfel*, Rausch, Wariach (language)
- Malwareswaldo: May*, Sanford (language)
- Team Uncreative: Sanders, Thatcher, Voels* (language)
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 .....
September 7, 2018