
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

22C:185 โ Fall 2004 Homework VI
1. [15 points] Using the revised version of the calculator presented on the class Web page, draw the abstract syntax tree and show how to use the semantic equations to evaluation the key sequence 10 M+ +6 +/- =x MR. 2. [15 points] This problem refers to the revised version of the calculator presented on the class Web page. You are to add a clear entry ( CE ) key to the calculator. The purpose of this key is to zero the display, but otherwise leave the state of the calculator unchanged. It should be valid to press this key at any time. Add the BNF to include this new key in the language, provide appropriate semantic equations, and justify their correctness. 3. [45 points] Extend the Wren syntax and denotational semantics in our text (Fig. 9.11) to incorporate three new operations. Add the increment operators of C to Wren. That is, allow (integer) subexpressions of the forms