simple calculator
If the expression given as input is illegal; indicate where the error was found and print an appropriate error message. Implement the program using two stacks: one for operands and one for other tokens.
Testing:
Test your program using at least the following:
BONUSES:
Full Definition of Expressions adapted from Pascal Language Definition
<unsigned constant> ::= <unsigned number>
<factor> ::= <unsigned constant> | (<expression>)
<term> ::= <factor> | <term> <multiplying operator> <factor>
<simple expression> ::= <term> |
<simple expression> <adding operator> <term> |
<sign> <factor>
<expression> ::= <simple expression>
<multiplying factors> ::= * | /
<adding factors> ::= + | -
Updated: