Here is an implementation in python of a simple arithmetic evaluator that evaluates expressions in reverse polish notation.

reverse

This implementation comes from this excellent article LL and LR Parsing Demystified.


Loading code from gist.github.com

This code snippet is live and interactive powered by the klipse plugin:

  1. Live: The code is executed in your browser
  2. Interactive: You can modify the code and it is evaluated as you type