Parsing Object Oriented Expressions with RPN
|
|
« Next Oldest | Next Newest »
|
▼
Post: #6
10-05-2010, 01:39 AM
▼
Post: #8
10-05-2010, 06:18 AM
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. ▼
Post: #9
10-05-2010, 12:57 PM
Quote: 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.
Thomas Edited: 5 Oct 2010, 12:59 p.m.
Post: #10
10-06-2010, 02:03 AM
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.
Namir Edited: 6 Oct 2010, 2:04 a.m. |