University of Texas at El Paso
Banner
Compuer Science
   
Assignment 2 Minimize    

Compilers and Interpreters: Assignment 2

September 12, 2005

Part A: Adding Loops

Extend the RoboLand language to handle loops. The syntax and semantics are as illustrated below:

; make a square
startloop 4
  go 12
  right
endloop
You need only implement top-level loops, not nested loops.

Part B: Adding Batch Processing

Extend the RoboLand language to handle invocation of scripts stored in files. The syntax is as illustrated below:

; execute commands from a file
run c://usr/longpre/square.rbl 800

This will execute the commands from the specified file, pausing 800 milliseconds between the execution of each statement.

Part C: Adding Nested Loops (Design Only)

Describe how you could extend your interpreter to allow nested loops.

Due Wednesday, September 24, at the start of class. Hand in (or e-mail me before Wednesday class)

  1. a printout of your revised Interpret.java,
  2. screenshots showing how it works,
  3. a printout of your nested loop design explanation.
  4. any documentation you think I should have.