For the use of low-level programming language is to achieve the processing of expressions, suffix (inverse polish) is the most convenient. The following is an algorithm that converts infix (common expressions) to Postfix:
Stack bottom ' # ', read infix verbatim from left to right:
A. When the current character is a number, the output is direct;
B. When the current character is "(", the stack is pressed;
C. When the current character is "", The Top "(") in the stack pops up and outputs all the preceding operators, and then deletes the "(" in the stack;
D. When the current character is an operator, it pops up in the stack with precedence greater than or equal to the current operator (until before), output, and then stack the current operator;
E. When "#" is displayed, the content output from all stacks pops up
Infix type: A * (B+C)/d+e
Suffix type: abc+*d/e+