An implementation to parse RPN and output the result.