Reverse Polish Notation

Reverse Polish Notation (RPN) is an unambiguous, parenthesis-free notation for arithmetic expressions. Operands precede the operators that apply to them:


A + (B * C)   -->   A B C * +

(A + B) * C   -->   A B + C *

It is easy to produce RPN as output of an operator precedence parser:

  1. Operands go directly to the output; no operand stack is used.

  2. When an operator is reduced, it is removed from the operator stack and put into the output.

Contents    Page-10    Prev    Next    Page+10    Index