Develop a RPN rational number expression evaluator (REEval).
The learning objectives are:
The REEval (Rational Expression Evaluator) C application supports evaluation of reverse polish notation (RPN) expressions containing fractions (rational numbers). It supports the four basic operations.
The evaluator reads a line containing a reverse polish notation expression to be evaluated, and outputs the result.
- Operands are input as positive fractions, like 2/3.
When the denominator value is 1, operands are input as integers giving the numerator value, e.g. 4.
- Operators may be +, -, *, :, =, s, or q (s to output the stack, q to quit the program).