- Extend the Tiny expressions with a modulo
operator
`%`

and an`abs(<exp>)`

function. - Extend the Tiny expressions with an exponentiation operator
`**`. Note that this operator is right-associative, i.e.`2**3**4`is to be parsed as`2**(3**4)`. Also note that this operator has higher precedence than all other numeric operators. - Fix the pretty printer to output the minimal number of parentheses required to preserve the semantics of the expression: not too few and not too many. You should include support for the additional operators from the previous steps.
- Introduce a unary minus
operator
`-<exp>`

as syntactic sugar for the expression`0-<exp>`

. This means that unary minus should be defined in the grammar, but not in the abstract syntax trees, meaning there should be no changes to the pretty printer or evaluator. This question is somewhat tricky in SableCC; there is no way in an AST transformation to create a '0' node. You can either a) create a null node and then use a later pass that replaces it with zero, or b) perform a post pass that fixes up any unary minus nodes directly. - The evaluator currently tries to determine the value of the input
expression. Fix it to:
- Handle division by constant zero properly. This means that an
error message should be printed for evaluating
`<l_exp> / <r_exp>`

where`<r_exp>`

evaluates to zero. - Handle partial evaluation of expressions involving identifiers.
For instance,
`a + 3 * 4`

should evaluate to`a + 12`

and no error message should be printed. - Perform basic algebra on identifiers. For instance,
`0 * a`

should evaluate to`0`

.

- Handle division by constant zero properly. This means that an
error message should be printed for evaluating

`testcases`

file that demonstrate your
ability to handle good and bad input appropriately. Running `make check`

will create a file called
`result`

that will contain the
output. We will combine the testcases from all groups and use them to
test your improved Tiny expression evaluators.Finally, based on your experiences, answer the following questions for your milestone report:

- Which toolset you will use for the WIG project?
- What was frustrating about this milestone? Difficult? Time consuming? Boring? Easy? Interesting? Fun? You can include discussion of things such as using version control, group coordination, and environment setup.
- What devious extension to the Tiny expressions should we ask students for next year?

This milestone is due by an espilon before midnight on Sunday 22th September 2013. With next week assignment, it will count for 5% of your grade. Marks will be generously deducted for late submissions.