Assignment #3 - Onyx Interpreter
Due: 11:59 pm Monday,
March 12, 2007
Description | Deliverables | Resources | Testing | Early Progress Incentive
| 11-Feb-07 | Original release of assignment. |
Your third assignment is to write an interpreter for the Onyx programming language, implementing the behavior defined by the Onyx Semantic Specification. The lexical, syntactic, and AST specifications for Onyx have been given in previous assignments.
The interpreter will output the value of a provided Onyx program (if the parse and scan succeed), else a representation of the syntax error contained in the input file, according to the error reporting requirements. Report only the first error encountered.
It is strongly suggested that you begin this assignment right away, and set periodic milestones for yourself. Remember to allow time for testing prior to the assignment deadline and do take advantage of the Early Progress Incentive mentioned below. To help you organize the work for this assignment, we have provided the A3 Phases document, which gives an ordered list of checkpoints. As always, test incrementally, and don’t forget to back up your work!
Note that, while the lexer and scanner web portals will be available for the duration of this assignment, the interpreter portal will unavailable until March 6th, six days before the assignment is due.
You will turn in your interpreter project as a UNIX tar archive. When untarred into an empty working directory, a Makefile must appear at the top level. Other files and directory structure may also appear, as appropriate, but must contain no ".class", ".o", ".jar" or executable files.
The Makefile must have a target named "onyxi". The command
make onyxi
issued in the top level working directory should build (i.e., compile) your interpreter, resulting in an executable file named onyxi in the working directory.
The onyxi program will be run with the command line of the form
./onyxi
issued in that working directory. It should read Onyx from standard input (which it may assume uses UTF-8 encoding). Normal output from the interpreter (i.e. the printed form of the value of the Onyx text) should be directed to standard output, again in UTF-8 encoding. Error messages from the interpreter--reporting syntax errors or static semantic errors or runtime errors--should be directed to standard error output.
Your assignment will be tested against a collection of test programs that we will use to determine the grade for your assignment. All the publicly available test cases will be incorporated into this collection of tests, so it is important that you carefully check your results against the published output.
The authoritative source for Onyx semantics is the Semantic Specification. In some cases certain Onyx behavior is not defined by the specification. You will not be tested against such behavior.
In addition to your assignment, you must include three other files:
Refer to the A3 Phases document for additional instructions about these files.Assignments that do not include a properly completed DECLARATION, MEMBERS, and TeamEval files will not receive a grade and will be treated as late assignments.
From the directory containing your Makefile, MEMBERS, DECLARATION, and TeamEval files and the root of your A3 development directory, run the command TURNIN.A3 and follow the dialog. You can run this command as many times as you want up until the assignment deadline; any earlier turnin of yours will just be overwritten. In fact, it is recommended that you run the command early, as soon as you have a partial solution to the assignment, to make sure the turnin mechanism is working for you.
DON'T WAIT UNTIL THE LAST MINUTE TO RUN TURNIN FOR THE FIRST TIME!!!
We strongly suggest that you perform a practice turn-in well in advance of the assignment deadline to ensure that you’ved any basic problems with TURNIN.
Late assignments will not be accepted.
As before, automated tools will check the contents of the output file for correctness with respect to the required file format and the syntax specification.
We will compare your output to a reference output (the output generated by our solution) using the xmldiff utility. You are encouraged to test your output using xmldiff against the given sample outputs made available as files in the ~/../public/Materials/A3/Tests/ directory on ieng6, to ensure their correctness prior to turnin. Of course, there are many cases not represented by the sample files provided there; you must also write your own test cases! You may find the utility xmlpp useful when reviewing the output of your program on your own test cases.
The public/Materials/A3/Tests directory includes test cases for the interpreter. There are two outputs for each test - a result file that adds a .xml suffix to the filename for its corresponding test case and an error file that replaces the .onyx with .err. Only one of these outputs will contain any content. In most cases, the error file is empty and the .xml file contains the result. Note that, only certain functionality will be tested for the Early Progress Incentive turnin. You therefore get feedback on a subset of the tests only. Consult the README file for the list.