CS 202, Fall 2007 Group Assignment #3: 50 Points. Due Date: Tuesday, 12/18/07. (15) 1. The Simple language compiler is deficient in numerous ways. The final group assignment is to deliver an enhanced Simple compiler implementing as many new features as possible. The new features should offer improvements in one or more of the following areas: (a) expression syntax, (b) error detection (c) user interface or (d) performance (SML code optimization). The announcement of the release of the enhanced group products will occur during in class presentations on Tuesday, 12/18. Each group will have approximately 30 minutes to describe why their compiler should be selected as the best implementation of the Simple language. Each group should describe the unique features of the design, implementation and testing of their version of the compiler in sufficient detail to convince the audience that the compiler is not vaporware and really works. All members of the group should participate in the presentation in some manner. The presentation should begin with a title slide listing the group name and members of the group. Additional slides should discuss the features of the compiler. Powerpoint is a good application to use for preparing slides. Live demonstrations are a good way to sell a product to the audience, if the demo is well planned and works correctly. The class presentation will be graded on the clarity of information, originality, organization, content, correctness and overall impact. (35) 2. The technical evaluation of the enhanced compiler will be scored separately according to the point values listed below. To receive full credit, each enhancement must be implemented, documented and demonstrated to receive full credit. All enhancements must be implemented in a single version of the compiler and should not require modifications to the Simpletron SML instruction set. Groups will receive credit for only one version of the compiler. All text, source code and executable files must be handed in on a CD, preferably together with the presentation files. The enhanced features and point values are as follows:** (5) a. Modify the compiler to produce a source code listing of the Simple program file followed by a listing of the contents of the symbolTable array to cout. The symbol table listing should be formatted into columns showing the location, type and value of each symbol in the table. (5) b. Modify the compiler to include comments in the SML code. Each numeric SML code should be followed by mnemonic for the code (READ, STORE, etc) along with the name of any operands from the symbol table. For example, if the variable 'x' is stored in location 98, then the operation code 1098 would be followed by the comment "READ x" on the same line of the SML code file. Note that this may require a modification to your simpletron simulator in order to process the operation codes followed by the mnemonic. Note also that the compiler should add a line containing -99999 to the end of the SML code file for compatibility with the simpletron input format. (5) c. Modify the functions which process the 'let' statement to allow multidigit numeric constants in expressions. (5) d. Implement the modulus operator (%) for use in expressions. The precedence of the modulus operator is the same as multiplication. The definition of the modulus operation for x%y is x-(x/y)*y, where '/' is integer division. (10) e. Implement the exponentiation operator (^) for use in expressions. Exponentiation is right associative and has higher precedence than multiplication. Exponentiation of x^y for integer operands is implemented in machine language by multiplying x into the accumulator y times. An exponent of zero should produce a result of one. Negative exponents produce a result of zero. (10) f. Add error detection and recovery to the Simple compiler so that error messages are output when syntax errors are encountered in a Simple program. When an error is detected, an informative message should be output and the compiler should skip to the beginning of the next line and continue compiling. The following types of errors should be detected: (i) Missing line number; (ii) Missing/misspelled keyword; (iii) Missing '=' in 'let' statement; (iv) Missing/unrecognized operator in 'let' expression. (10) g. Modify the Simple compiler to provide an option for optimizing the SML code produced by the compiler as described in Exercise 21.28. Manually compare the nonoptimized code with the optimized code for the Simple factorial program and calculate the percentage reduction in memory use and in total instructions executed. (10) h. Integrate the Simpletron simulator, the Simple language compiler and a text editor into a menu-driven Simple language development environment which provides a source editor, compiler, debugger and execution of Simple language programs. (XC) i. Propose a different enhancement and receive extra credit points with the approval of the instructor. Extra credit may be earned for enhancements in accordance with the guidelines given in the project requirements. Enhancements will typically receive a maximum of 5 points, but additional points may be awarded at the discretion of the instructor. **For full credit, turn in fully commented program listings, including group name and the problem number(s), and the output from test runs exactly as produced by the program.