Converting INFIX to RPN:

 

1.  Scan the expression from left to right.

2.  When an operand is encountered, move it immediately to the RPN expression.

3.  When an operator is encountered,
            First, remove the operators from the stack and place them in the
            RPN expression, until either the stack is empty or the priority of
            the top operator is less than the priority of the operator encountered.

            Then, push the operator just encountered on the stack.

4.  When the entire infix expression has been processed, remove any remaining operators from the stack and place them in the RPN expression.

    Parenthesis Rules:

5.   When a left paren is encountered, push it on the stack.

6.   When unstacking operators with greater or equal priority than the operator encountered   in the infix expression, if a left paren comes to the top of the stack, terminate the unstacking.

7.   When a right paren is encountered in the infix expression, unstack operators until a matching left paren is found on the stack, then discard both parens and continue.