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.

README file

A plaintext README file 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 make file or a build shell 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, and kleinc. 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 README file, 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.

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.