/reverse-polish-notation-js-parser

A reverse polish notation parser calculator based on javascript

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Reverse Polish Notation Calculator and Converter

Because when you're bored, there's no going back...

If you have no idea what's Reverse Polish Notation, you can check it out on wikipedia.

Demo: https://wisdomsky.github.io/reverse-polish-notation-js-parser/


Compile

If you want to try to compile the source by yourself, be sure to check out Jison.

> npm install jison -g
> jison grammar/rpn-grammar.jison

Run

From CLI:

node rpn sample.txt 

For Web:

    <script src="rpn.js"></script>
    <script>
            console.log(rpn.parse('1 2 / 3 + 4 5 * -'))
    </script>