CSE 321 Closed Lab 6 Instructions

This closed lab has two parts: The first part consists of entering the implementation for the Next_Primitive_Instruction operation that you wrote for the warm-up exercise, and testing your implementation. The second part is optional. You can enter your implementation for the Next_Primitive_Instruction operation in the BugsWorld Client application and then compile it and try it out in a BugsWorld simulation. Please carefully follow each step of the instructions below.

  1. Objectives: To provide an implementation for the BugsWorld virtual machine interpreter in the Next_Primitive_Instruction operation.

  2. Set Up For Part 1: Each team should work together at one workstation.
    1. Copy the closed lab #6 course catalog to your group project directory (/project/c321axnn, where "x" is your section letter and "nn" is your team number):
      cp -r /class/sce/now/321/closed-labs/catalogs/closed-lab6 /project/c321axnn
      
    2. Make sure that the new catalog will be accessible to your partner. Perform this action now and as your last act whenever you finish a working session. Note that 'l' in the chmod command is the letter 'l' ("el"), as in "lock":
      cd /project/c321axnn/closed-lab6
      
      chmod -R g-l,g+rwX .
      
      set-group-ID .
      

  3. Implement Global Operation: Fill in the operation body for the Next_Primitive_Instruction operation in the file CL6_Test_Driver.cpp.

  4. Compile and Test: Do a Build Project for CL6_Test_Driver.cpp. Once all syntax errors are corrected, run the test driver using any valid BL program (a sample BL program, TestProgram.bl, and its compiled version, TestProgram.bo, are provided in the catalog). If you use your own BL program, you will first need to compile it with the 321_Translator. Once you are confident that your implementation of Next_Primitive_Instruction is correct, double check by running the test driver with input from the provided file, input-script, and comparing the output with the correct output provided in file correct-output. You can do that with the command retest CL6_Test_Driver input-script correct-output (which you have already used in 221 and 222 for this purpose). If no output is produced by the retest command, then the test cases failed to reveal any problems with your implementation. If any output is produced, your implementation is not correct and you will have to debug it.

  5. Proctor Check-off: When you are satisfied that your implementation is working correctly, raise your hand and one of the proctors will come check it. Then you can move on to the second (optional) part of the closed lab.

  6. Set Up For Part 2: Provided in your closed-lab6 user catalog is the source code for the BugsWorld simulation Client application. It is named Client.cpp-DC (where the DC at the end was added to prevent this file from being compiled when you were building CL6_Test_Driver.cpp). You should rename this file with the command mv Client.cpp-DC Client.cpp.

  7. Complete Client Application: Fill in the operation body for the Next_Primitive_Instruction operation in the file Client.cpp. Feel free to look around the rest of the program, and ask questions if you are interested in the details of how the Client communicates with the Server.

  8. Compile and Test: Do a Build Project for Client.cpp. Then you can run a BugsWorld simulation as described in the Closed Lab 2 Warm-Up Exercise replacing the 321_Client with your Client application.