Assigned:
Wed 28 Jan 2004
Due:
Wed 04 Feb 2004
Problem | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | ... |
---|---|---|---|---|---|---|---|---|---|---|
Credit | RC | RC | RC | EC | RC | RC | NA | RC | RC | ... |
where "RC" is "regular credit", "EC" is "extra credit", and "NA" is "not applicable" (not attempted). Failure to do so will result in an arbitrary set of problems being graded for regular credit, no problems being graded for extra credit, and a five percent penalty assessment.
For each problem where you are required to devise a CFG, you must clearly indicate the purpose of each of your non-terminals. This can be accomplished most effectively by specifying the language generated by each non-terminal, as we did in class, for example.
Required: 7 of the following 9 problems
Points: 14 pts per problem
Hint: The ambiguity present in the grammar shown in
Problem 2.21 is due to the if-then
and
if-then-else
statements. The ambiguity you will discover
is referred to as the "dangling else" ambiguity.