CSE 321 Closed Lab 4 Instructions

This closed lab has two parts: First you will enter and test your implementation of the Pretty_Print extension. After that, you will enter and test your implementation of the Program_Kernel operations. Please carefully follow each step of the instructions below.

  1. Objectives: To provide an implementation, Program_Pretty_Print_1, for the Program_Pretty_Print extension to Program_Kernel and to to provide an implementation, Program_Kernel_1, for the Program_Kernel component.
  2. Set Up For Part 1: Each team should work together at one workstation.

    1. Copy the closed lab #4 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-lab4 /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-lab4
      
      chmod -R g-l,g+rwX .
      
      set-group-ID .
      

  3. Implement Program_Pretty_Print: Fill in the Pretty_Print operation body (and the Print_Spaces local operation body) in the file CT/Program/Pretty_Print_1.h. Note that to pretty-print the body of the program and the bodies of user-defined instructions you can (and should) use the Pretty_Print operation for Statement.

  4. Compile and Test: Do a Build Project for CL4_Test_Driver.cpp. Once all syntax errors are corrected, run the test driver. The test driver is a BL parser that reads in a BL program and, if no syntax errors are found, outputs a pretty-printed version of the original program. You will have to invoke it with a command like this: CL4_Test_Driver < source.bl, where source.bl is a file containing a syntactically correct BL program. The output is sent to the window from which you issued the command. Two sample BL programs are provided (TestProgram1.bl and TestProgram2.bl), but you may also want to test your implementation on your own BL programs.
  5. Set Up For Part 2: Once you are confident that your implementation of Program_Pretty_Print is correct, you need to copy a skeleton of the Program_Kernel_1 component into your closed-lab4 catalog.

    1. Copy the the Kernel_1.h skeleton in your closed-lab4 catalog. Note that the Kernel_1.h file must be copied in the CT/Program directory in your closed-lab4 directory under your group project directory:
      cd /project/c321axnn/closed-lab4
      
      cp /class/sce/now/321/closed-labs/catalogs/closed-lab4-part2/CT/Program/Kernel_1.h CT/Program
      
      chmod g+rw CT/Program/Kernel_1.h
      
    2. Before you go on, you must also get rid of the files created by Build Project in Part 1. Go to a terminal window and (while in the closed-lab4 directory) issue the command: rcpp-make clean.

  6. Implement Program_Kernel: Fill in the operation bodies for the seven kernel operations in the file CT/Program/Kernel_1.h

  7. Compile and Test: Before you do a Build Project for CL4_Test_Driver.cpp, make sure you have removed the files created by Build Project in Part 1, as explained in step 5.2. After that, you can do a Build Project for CL4_Test_Driver.cpp. Once all syntax errors are corrected, run again the test driver.
  8. Proctor Check-off: When you are satisfied that all implementations are working correctly, raise your hand and one of the proctors will come check it. Then you are finished with the closed lab.