1
UNIVERSITY OF THE WEST INDIES
Department of Computing
COMP3652–Language Processors
Semester I, 2013
Lecturer: Dr. Daniel Coore
Assignment 2
Due Monday, November 18, 2013
Introduction
For this assignment, you will be completing the implementation of an interpreter for fractal, a language for creating and combining simple fractal shapes. The language specification has been provided in a separate document. You will need to consult that document in order to complete this assignment. Although graphics are involved in this assignment, you will not need to implement your own graphics routines, nor to create your own classes to manage the drawing of shapes to the screen. …show more content…
You are well advised to take a look at these classes, as well as the documentation for the classes in cs34q.jar while planning your implementation of
FractalEvaluator. You should not have to edit AbstractFractalEvaluator, and you have not been provided with the source code for Turtle or TurtleDisplay, so you may not edit the behaviour of those classes either. You may edit FractalState if you find that it is necessary to do so.
You can test your interpreter on the example files provided in the examples directory, but you should not limit your tests to only those provided there.
[25]
b. Use your interpreter to create a new fractal program. See whether you can create something that produces unexpected results. (Have fun!). Submit both your program, as well as the image it produced (take a snapshot of the whole FractalEvaluator window).
[5]
Problem 3: Bonus: Procedures [15]
As currently defined, fractal contains no support for defining functions or procedures. Add a new special form to fractal that would allow the user to define and call procedures with numerically valued arguments. The syntax of a call should look like the usual infix syntax (e.g. as used in C,
Java and Python). The syntax of a procedure definition should