Parsing Object Oriented Expressions with RPN


Incredibly geeky hyperlink.


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.

Possibly Related Threads...
Thread Author Replies Views Last Post
  [PRIME] RPN: another attempt at returning more than one value to the RPN stack Marcus von Cube, Germany 5 1,228 11-05-2013, 02:44 AM
Last Post: Marcus von Cube, Germany
  HP Prime - Saved formulas, expressions CR Haeger 6 1,048 10-07-2013, 08:25 PM
Last Post: CR Haeger
  HP-Prime: issues in entering expressions fhub 30 3,443 10-02-2013, 12:32 AM
Last Post: Tim Wessman
  PRIME runtime vs. parsing. Chris Tvergard 7 1,016 09-25-2013, 03:26 PM
Last Post: Chris Tvergard
  Product Series and Limit Expressions on the 50G Matt Agajanian 13 1,850 09-03-2013, 02:02 PM
Last Post: Simone Cerica
  OT: Google evaluates mathematic expressions (with a twist) DavidShenk 4 909 02-13-2013, 09:05 AM
Last Post: Juan J
  Immediate algebraic expressions in RPL+ Oliver Unter Ecker 8 1,140 11-19-2011, 04:29 AM
Last Post: Oliver Unter Ecker
  Help: how to get the hp-50g to work on expressions. Luca 2 585 08-17-2009, 12:39 PM
Last Post: Luca
  How to compute the value of symbolic expressions in HP-50g? Luca 2 515 08-17-2009, 02:36 AM
Last Post: Luca
  New Iphone & Itouch calculator - Access RPN and Active RPN Nigel Bamber 1 563 06-10-2009, 04:13 PM
Last Post: Jean-Michel

Forum Jump: