saintmike has asked for the wisdom of the Perl Monks concerning the following question:
does anybody know of a module solving the classic compiler class task of translating an arithmetic expression into RPN (reverse polish notation)? Basically, I have something like
and want it to be transformed into"2*(somevar+other) + max(this, that)"
There's a couple of related modules on CPAN, like Parse::RPN or Math::RPN, but neither one does the trick.("2", "somevar", "other", "ADD", "MULT", "this", "that", "MAX", "ADD")
Any pointers to code snippets would be great, before I roll my own.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Generic RPN Translator available?
by stvn (Monsignor) on Jan 19, 2005 at 14:48 UTC | |
Re: Generic RPN Translator available?
by Jasper (Chaplain) on Jan 19, 2005 at 10:02 UTC | |
Re: Generic RPN Translator available?
by Anonymous Monk on Jan 19, 2005 at 09:39 UTC | |
Re: Generic RPN Translator available?
by BrowserUk (Patriarch) on Jan 20, 2005 at 09:34 UTC | |
by dfaure (Chaplain) on Jan 20, 2005 at 22:22 UTC | |
by saintmike (Vicar) on Jan 21, 2005 at 03:37 UTC | |
by BrowserUk (Patriarch) on Jan 21, 2005 at 06:15 UTC | |
by BrowserUk (Patriarch) on Jan 21, 2005 at 08:50 UTC | |
| |
by BrowserUk (Patriarch) on Jan 20, 2005 at 22:33 UTC | |
by dfaure (Chaplain) on Jan 20, 2005 at 23:50 UTC |