Building a pretty printer
This is your fifth module for your Designer Programming Language assignment.
You may develop your code
any of the allowed procedural language,
but you must ensure it runs correctly under Linux
Your task is to write a pretty printer for your language.
pretty printer reformats a source code file in a pleasing
For this task, however, your pretty printer output can be quite
ugly, as long as it is correct.
Start be reading this.
Note: unlike the other milestones, this milestone will be worth up to
2 extra credit points added to your final percentage.
Coding standards are as before.
you are to write a pretty printer for your language.
One should be able to run the pretty printer on a file
consisting of a single program by
typing in the command:
$ pp FFFF
FFFF is the name of the file to be
You should supply a three short test cases.
Your README file should specify which test cases result in
which outputs. One should be able to run the tests with
the makefile targets: test1, test2, and test3.
Each target should do something like this:
test1 : pp
@echo Original file:
@echo Pretty Printed version of the original:
@pp test1.mylang > test1.pp.1
@echo Pretty Printed version of the pretty printed version:
@pp test1.pp.1 > test1.pp.2
diff -s -q test1.pp.1 test1.pp.2
Submitting the assignment
To submit your assignment,
delete all object or class files from your
leaving only source code,
a README file,
and any test
cases you may have.
while in your working directory,
submit proglan lusth pretty
The submit program will bundle up all the files in your current
directory and ship them to me.
This includes subdirectories as well
since all the files
in any subdirectories will also be shipped to me.
You may submit as many times as you want before the deadline; new
submissions replace old submissions.
Make sure you that I will be able to call your pretty printer with the
command named pp.
The command pp must
take a filename as a command line argument.
You must supply a makefile that will compile your pretty printer when
responding to the commands make and make run.
The make run command should test your implementation on your own
Version 2 : Thu Feb 14 10:34:45 : corrected references to recognizer.