This assignment makes use of the files contained in this zip file. This assignment is due Monday, March 29.
This assignment is based on Language_7 and programming assignment 3. You will add one new Value type to Language_7 (arrays), several new expressions, and also the for and repeat loops from Langauage_6a to create Language_7a.
In the zip file there is a file Language_7a.txt
that describes the syntax and semantics of Language_7a. Your assignment is to add code to the interpreter for Language_7 so that the new interpreter can handle array values and array expressions. Language_7a also includes the for-loop and repeat-loop expressions from Assignment 3 and the increment/decrement, spaceship operators from Assignment 2.
In the zip file there is the file Evaluate_7a.java
. As distributed, this file is the interpreter for Language_7. Your assignment is to copy your code for the for-loop, repeat-loop, inc/dec operators, and spaceship operator from Language_6a into Evaluate_7a.java
and then add code that handles the new array expressions. You also need to modify the file Value.java
to add to it the new array type.
When you have finished implementing Language_7a.java
, include your version of PrettyPrinter2.java
from Assignments 2 and 3 in the hw4
folder. Then the file Language_7a_Examples.java
should compile and run. The output from running this program should look almost exactly like Language_7a_Examples_output_debug_0.txt
or Language_7a_Examples_output_debug_1.txt
, depending on how you set the debug level (your output cannot look exactly like either of those files because some of the output is randomly generated). Also, make sure that you didn't break anything from Language_7 or Language_6a. The programs Language_7_Examples.java
and Language_6a_Examples.java
from the zip file should also compile and run correctly and the programs' output should look exactly like Language_7_Examples_output_debug_0.txt
and Language_6a_Examples_output_debug_0.txt
.
In the zip file there is the file Language_7a_Runtime_Errors.java
that gives you an idea of the kinds of runtime errors that your interpreter code should check for.
As before, you get the interpreter to produce all the extra debug output by setting the static variable
DEBUG = 1;
in the file Evaluate_7a.java
.
Turn in a zip file called CS51530Hw4Surname.zip
(where Surname
is your last name) containing your versions of Evaluate_7a.java
, Value.java
, and PrettyPrinter2.java
(just those three files). Be sure to put your name and email address in every file your turn in.
This assignment is due Monday, March 29.