CS 5363: TL09 Compiler Project, Submission Instructions

  1. Accounts
  2. Software Tools
  3. Subversion
  4. Documentation
  5. Directory Structure
  6. Impelementation-Language Specific Instructions
  7. Errata

CS Accounts and Machines

Every student enrolled in a CS course, automatically gets a department account. These are used to log in on the machines (in Linux or Windows) in the department labs (e.g., SB 3.02.04). These accounts can also be used to log into main201.cs.utsa.edu through main214.cs.utsa.edu remotely using ssh.

For most CS department accounts, the username is the person's first initial, followed by their last name (up to a maximum of seven characters). And the initial password is is the user's banner id without the @ in front.

Software

The assignments for this class may be done locally on the department machines, on main2XY through ssh, or on your home machine. It is recommended that you at least test your work on a machine running Ubuntu 9.04 (Jaunty Jackalope), such as the main207-main214, since that's what we'll be using when we grade your submissions. If you want to do your work on a home machine or a laptop running Windows, you may want to look at Portable Ubuntu Remix or WUBI.

In order to do your assignments you will need to have:

You may also find it useful to use an IDE, such as Eclipse, and an interactive graphviz dot file viewer, such as zgrviewer.

Subversion Repositories

Project will be submitted through subversion repositories. Subversion is typically used to facilitate collaboration among multiple individuals working together on a single software system. In this case, one subversion repository has been created for each student and is also accessible by the instructor and TA. Access can be obtained using the department username and password at the URL: https://nougat.cs.utsa.edu/cs5363-f09/cs5363-<username> (where <username> is replaced with that student's CS account username.)

Students can checkout a working copy of their repository, and then do their project development within that working directory. Students should periodically commit their work to their repository. Subversion provides abilities to look back through the history at any previously committed version of files. It also facilitates moving files back and forth between different work environments.

The most recently committed work at the time of each grading deadline will be graded. It is important that this last revision compile and run. You should check that the correct versions of all required files (for the appropriate phase) have been added, and committed by each due date. If you aren't familiar to subversion, one way to check that all of the files are present is to point your web browser at the repository, https://nougat.cs.utsa.edu/cs5363-f09/cs5363-<username>. The most recently committed version of all files should be viewable. Another way to check your repository is to do a fresh checkout into a new directory (perhaps on one of the main2XY machines) and then check that the files are all there and the source compiles.

The basic commands necessary to use subversion are:

More information can be found in the Subversion book, which is available for free online.

Documentation

Prior to each submission deadline, you should prepare a README file describing the current state of your project at that time. The README file should contain:
  1. a summary of the current state of a compiler,
    • How complete is your compiler? (i.e., Does it produce parse tree, AST/types, ILOC/CFG, MIPS assembly? Does it work for the whole TL09 language or only parts of it?)
    • known bugs (i.e., Does it fail to compiles? Does it produce any compiler warnings? Are there any test programs that crash the compiler or for which the compiler produces incorrect output?)
  2. a summary of how you have tested your compiler,
  3. which programming language was used to implement the compiler,
  4. instructions for how to build and run your compiler (Regardless of what you put here, the language-specific requirements below apply.),
  5. a description of any assistance received if any (This does not need to include assistance received from the instructor, from the TA, or on the class newsgroup.),
  6. the statement that "This submission is my own work. All assistance other than that received from the instructor, from the TA, or on the class newsgroup, has been described in full above.",
  7. your name, and
  8. the date the README file was created or last modified. (This should be the same as the date of the last commit into svn.)

Directory Tree

In order for the instructor and TA to efficiently grade the assignments, it is necessary that we place some specific instructions on how your source code and other files are put in the repository, so that we can compile and run that code in an efficient way.

Within the repository, you should have three top-level directories: phase1, core, and extensions for submitting the files associated with each of the corresponding project phases.

Each of these directories should contain a README file (as described in the "Documentation" section above), a file named LANGUAGE (that contains a single line with the word "Java", "C++", "ML", or "Scala" corresponding to your chosen implementation language), a test-inputs directory (containing the TL09 programs you used to test your compiler) and a src directory (containing the source code for your parser).

The submissions for the "Review I," "Review II" deadlines as well as for the final core deadline should be submitted in the core directory. The requirements for the core directory at the "Review I" and "Review II" deadlines is the same as for the final core phase deadline except that README.R1 and README.R2 files should be created instead of README.

None of the directories in the subversion repository should contain object files, class files, exececutables, or your compiler's output files. (These may reside in your local subversion working directory, but they should be "ignored" or "unknown" to subversion.

Additional Instructions by Implementation Language

Java

If you are implementing your compiler in Java...

  1. The LANGUAGE file contains a single line consisting of the word: Java.
  2. The repository should include empty phase1/build, core/build, and extensions/build directories.
  3. The src directory should contain the Java source files in directories matching the Java package.
  4. The main method for each phase should be placed in the class edu.utsa.tl09.Compiler which would be stored in the file under src/edu/utsa/tl09/Compiler.java within each phase directory (phase1, core, and extensions).
  5. From within the phase1, core, or extensions directory, your TL09 compiler should be able to be compiled using the command: javac -d build -sourcepath src src/edu/utsa/tl09/Compiler.java
  6. The main method of the Compiler class, should expect a parameter specifying the input TL09 filename (ending in .tl09). The names of the output files should be automatically derived from the input file name by extending the base input file name with a new suffix denoting the contents and type (.pt.dot for the parse-tree dot file, .ast.dot for type-annotated AST dot file, .cfg.dot for the ILOC-labelled control flow graph dot file, and .s for the MIPS assembly code output.
    1. For examples, from within the phase1 directory, you should be able to use your TL09 compiler to compile the TL09 file simple.tl09 in the testing directory with the command: java -classpath build edu.utsa.tl09.Compiler testing/simple.tl09
    2. In this case, the output file for Phase I would be stored in testing/simple.pt.dot (relative to the phase1 directory).
  7. Class files built from your TL09 compiler source should not be added to the subversion repository.
  8. Output files from your TL09 compiler should not be added to the subversion repository.

C++

If you are implementing your compiler in C++...

  1. The LANGUAGE file contains a single line consisting of the word: C++.
  2. The repository should include empty phase1/build, core/build, and extensions/build directories.
  3. The src directory should contain the C++ source files (ending in .cc and header files (ending in .hh).
  4. From within the phase1, core, or extensions directory, your TL09 compiler should be able to be compiled using the command:
    g++ -o build/tl09 -Wall `find src -name '*.cc'`
    
  5. The main function, should expect a parameter specifying the input TL09 filename (ending in .tl09). The names of the output files should be automatically derived from the input file name by extending the base input file name with a new suffix denoting the contents and type (.pt.dot for the parse-tree dot file, .ast.dot for type-annotated AST dot file, .cfg.dot for the ILOC-labelled control flow graph dot file, and .s for the MIPS assembly code output.
    1. For examples, from within the phase1 directory, you should be able to use your TL09 compiler to compile the TL09 file simple.tl09 in the testing directory with the command: build/tl09 testing/simple.tl09
    2. In this case, the output file for Phase I would be stored in testing/simple.pt.dot (relative to the phase1 directory).
  6. Object and binary files produced by g++ from your compiler source code should not be added to the subversion repository.
  7. Output files from your TL09 compiler should not be added to the subversion repository.

ML and Scala

For submissions in ML or Scala, any reasonable directory tree layout for the source code is acceptable. (At least until there gets to be lots of ML and/or Scala submissions.) Please create a LANGUAGE file indicating that the implementation language is ML or Scala . And include instructions for how to build/run your program, using the standard smlnj or scala compilers/environments in the README file. The Tl09 compiler should be able to accept the name of the TL09 source program from the command-line, and produce output files based on the stem of the input filename (as described above for Java/C++); this should be documented in the README file.

Example

You may wish to refer to this zip file. For an example of how the files should be layed out within your subversion repository for a Java submission. This includes a Compiler.java with a main method that opens input and output files of the correct names based on the command-line arguments.

Errata/Clarifications

There may need to be corrections, clarifications, or other modifications to these instructions, you are responsible for monitoring the class web site and listening during lecture for announcements related to this assignment.