CS0447 Project 2 Due February 27 (at mid-night) The purpose of this assignment is to write a program that calls a recursive procedure in MIPS. See the announcements web page for details about what to submit. PROJECT: Write a program in MIPS R2000/R3000 Assembly language that reads a mathematical expression which contains integers, operators and matching parentheses, evaluate the expression and print the result. To simplify the program, assume the following: - each integer in the expression is between 0 and 9 - only the operators +, - and * are allowed - expressions are evaluated strictly from left to right, except when parentheses are used to override this order (note that this is not the way expressions are usually evaluated). EXAMPLES: > enter expression: 5 + 3 * (1 + 2) - 6 * 2 > this expression evaluates to 36 > enter expression: 7 + (2 * ( 9 - 4 ) + (2 + 1) ) - 30 > this expression evaluates to -10 > enter expression: (4 + 6) - (3 * (4 - 2) + 1) * (3 - 1) > this expression evaluates to 6 The main program should read the expression, discard blank characters, check the validity of the non blank characters and store these characters in an array of bytes. Only 0, 1, ..., 9, *, + , - ( and ) are valid characters. Your main program should call a subroutine "Eval" with a pointer to the beginning of the expression. Eval will then proceed in evaluating the expression (from left to right) until it either encounters the end of the expression or encounters an "(", in which case, it calls itself recursively. You can simplify the logic in "Eval" if your main program adds an "(" at the beginning of the expression and an ")" at the end of the expression. This way, Eval will return successfully only when it encounters an ")". In addition to invalid input characters, your program should detect invalid expressions. EXAMPLES: > enter expression: 5 + 3 * (1 / 2) - 6 * 2 > INVALID character > enter expression: 7 + (32 * ( 9 - 4 ) + (2 + 1) ) - 30 > INVALID expression > enter expression: (4 + 6) - (3 * (4 - 2 + 1) * (3 - 1) > INVALID expression In the first example, the character "/" is invalid. In the second example, the integer 32 is not between 0 and 9. In the third example, there is a mismatch in the parentheses. NOTE: In /afs/cs.pitt.edu/usr0/melhem/public/html/447/examples/prog3 you will find a program that reads the expression from the terminal remove the blanks, add ( at the beginning and ) at the end, and stores the result in array. This should cut a few hours of work on your assignments. The program, however, does not check for the validity of the input.