The Project Directory
Introduction
You will deliver each stage of your project in the form of a code repository. The repository is a directory that contains all of the code and documents you create for the project.
This page describes a standard set of files for the project directory and a standard way to organize the directory. Please manage your project directory in a similar fashion over the course of the semester. If you would like to deviate in a significant way, please run your ideas by me.
Contents
Your project directory should contain the following items at the top level.
READMEfile-
A plaintext
READMEfile provides basic information about your project to the reader. It should begin with these sections, in this order:- the team name and the names of all team members
-
a basic description of project, including
- explanation of the files and tasks implemented for the current assignment
- a list of known bugs in all phases of the project
- a list of any languages features not implemented in your compiler
- a description of any optimizations you implemented
-
a description of how to build your compiler, if
necessary, showing the steps to compile and link the
source code of your submission. Preferred solutions
include a simple
makefile or abuildshell script of your own creation. - a description of how to run the various components of your compiler, using the names of the Unix scripts included in the submission (see below)
The README may also explains the top-level architecture of your compiler and any design decisions that you think will help the reader understand your program better. It can point to more detailed documentation in the
doc/directory (see below). - compiler tools
-
Over the course of the project, you will create five scripts
that make up the command-line suite of your compiler:
kleins,kleinf,kleinp,kleinv, andkleinc. Add each script at the corresponding point of the project, as assigned. src/directory-
The
src/directory contains all of the source files that implement your compiler. This includes:- the code for the various modules (scanner, parser, etc.)
- the various data structures used by the modules (tokens, AST nodes, etc.)
- the drivers for the various modules (tokenizer, AST printer, etc.)
Be sure to clean up this directory before you submit a deliverable. Stray
*.class,*.java~, and__pycache__files distract the reader and exhibit a lack of care. doc/directory-
The
doc/directory contains all of the files that document your work, including:-
any old versions of your
READMEfile, either numbered by project module or integrated into a single document - the full language grammar from the project page
- the refactored grammar you used to build your parse table
- any data files that document your design, including the regular expressions and finite-state automata for tokens, the parse table, and the memory layout of you run-time system
- any other files, images, or design documents you have created, such as images of the finite state machines implemented by your scanner
These files can be plaintext, PDF, or image files. Whenever feasible, plaintext is preferred.
-
any old versions of your
programs/directory-
The
programs/directory contains any legal programs written in the source language. The most important of these are the programs your team writes for the various project modules. The directory may also contain source programs you write for your own use and source programs provided in the directory linked from the project web page. tests/directory-
The
tests/directory contains the all of the code you create to test your compiler. This might include:- unit tests written in your implementation language that work within an automated test framework
- source files you create to test your compiler, such as files containing lexical, syntactic, and semantic errors
misc/directory-
If you create any other files as a part of your project that
do not fit in one of the directories described above, put
them in a
misc/directory.
Miscellaneous Notes
Here are a few things to keep in mind as you work on your project.
- Keep in mind: Your compiler may contain only code written by you, by one of your teammates, or by a program that you write. It must not contain any code written by any other person or generated by any program that you did not write.
- However, I encourage you to discuss the assignment with me and with other students in the course. Learning how to think about big programming problems is an important part of this course, and we learn best what we describe to others, interpret, and do.
- Please adopt the programming standards of whichever language you are using. If you are writing your program in Java, please use reasonable object-oriented style where appropriate. If you are writing your program in Python, please use standard Python programming style. If you are writing your program in Racket, please use good functional programming style.