Implementing the calculation of arithmetic expressions using the stack