Studio 4: Give me Ambiguity or Give Me Something Else

Studio Sessions Overview:

The results of your studio session are to be reported and documented in a file that you save in your workspace. You are to print and turn in one copy of that report for your group. In the descriptions of the studio exercises, verbs like report and document are indications of activities you should summarize and discuss in your report.

In your groups, take turns documenting results, looking over shoulders, and staffing the keyboard.

It is unacceptable to copy anything without understanding it. At any point, the TA or instructor can point to something you've done and ask you why it works, or change it and ask what would happen with the modification.


In each of the following sections, go as far as you can in the time allotted, but move on to the next section so you'll have a chance to work on each section while in studio.

Warm Up: (10 minutes)

  1. Read/review the following
  2. Open the CUP User Manual for quick reference.
  3. Open eclipse and carefully follow the following steps. If these steps do not work for you, switch to a new workspace and try again.
  4. Import (File..Import) this zip file using the Existing projects into workspace method (Do not choose the archive file method). After clicking on "Existing projects into workspace" select, as the archive file, the file you downloaded earlier.
  5. Open Main.java as you will have to uncomment some things to test. Don't uncomment anything yet, though.
  6. Right-click on the build.xml file and run it as an Ant Build...

  7. The build should work and you should see the output from running all of the parsers in the console window.


    Hereafter, you can run this build by clicking on the arrow with the red toolbox.

  8. This should produce some output in the console window. Not much will be working at this point, and most runs will die in CUP showing Java Error: 100

Main Problems

cup0
This is a short grammar you'll type in yourself by now, having followed the warm-up instructions above.
cup1
Follow the instructions in the grammar file -- be sure to check your work with another group and the TA or prof.
cup2
Follow the instructions, ask questions as needed, check your answers with other groups and the TA or prof.
cup3
Some lines of this file are NOT to be modified -- check this out before you start changing things. Follow the instructions, but ask questions and check your work as you go with others.
cup4
Same deal -- ambiguous, not? Figure it out and fix it up
cup5
I don't expect anybody to get this far, but if you do, this is part of Lab 3. Take a look and talk about it if you have time. We'll work more on it next studio.

Finally

Be sure to submit the following before leaving studio:



Last modified 16:07:23 CST 25 February 2008 by Ron K. Cytron