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.
All of your work will be done in the jmm.cup file. Work carefully, in groups as usual, but feel free to bounce ideas off others around you. For each of the situations below:
SelectionStatement
::= IF LPAREN Expression RPAREN Statement ELSE Statement
/* | IF LPAREN Expression RPAREN Statement
*/
;
Leave the first production alone, but uncomment the second one, so that
both are considered by CUP. Address the resulting ambiguity.
PrimaryExpression
::= QualifiedName:t
| NotJustName:rhs
/*
* You will eventually have to explain the conflicts that arise when the rule below
* is uncommented.
* This rule lets a block ( { .... } ) serve anywhere a primary expression could.
* So you could write a = { while (h>5) h = h -k; };
*
* | Block:rhs
*/
;
Uncomment the last production so it can be considered by CUP. Address
the resulting ambiguity.
Be sure to submit the following before leaving studio:
You are welcome to use the work done in studio for this portion of your Lab 3 assignment. Just be sure to credit the group for the work done for these parts.