HP Forums

Full Version: Parsing Object Oriented Expressions with RPN
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Very cool Howard, thanks for posting it. ;)

For what it's worth, this is basically how an algebraic calculator evaluates an expression that you type. So in a way, even TI's are RPN at heart :).

HP calculators do the same thing when they parse a symbolic expression because symbolics are stored in postfix notation.

symbolics are stored in postfix notation.

That's why you can't enter something like '(A+B)'. It is stored as 'A B +' and displayed as 'A+B'.

BTW: There's a programm ->RPN in the directory 'EXAMPLE/PRGS' you get when executing the command TEACH. It transforms an algebraic expression to its equivalent RPN-representation.


Edited: 5 Oct 2010, 12:59 p.m.

Several years ago I wrote an expression parser that converts an algebraic expression (with variables and functions) into an array of RPN tokens. This approach allows the re-evaluation of the expression multiple times without having to re-parse each time. It was a fun project in VB .Net.

The program's GUI would list the parsed RPN expression.


Edited: 6 Oct 2010, 2:04 a.m.