Jump to content
Sign in to follow this  
mgh

Infix to RPN

Recommended Posts

I have an incomplete and buggy application to convert expresions from normal (infix) notation to reverse polish notation (RPN) needed for XML gauges. As an example, it converts:if{ ( A > B ) && ( C < D ) } ( X + 2 * Y ) toA B > C D :(becomes a b maxEDITIt also replaces '>' with '& gt ;', '<' with '& lt ;', and '&' with '& amp ;' (without the spaces) but the forum changes them back!

Share this post


Link to post
Share on other sites
Guest Mathias

Great interest here, I just can't get my head to think in RPN, particularly when it gets messy and complex. In a way you are thinking about a kind of compiler :)

Share this post


Link to post
Share on other sites

I've tidied it up and will be happy to email it to 2 or 3 people for comment before deciding whether to upload it to the library.First come, first served!

Share this post


Link to post
Share on other sites
Guest Mathias

As I believe the testing should be done by XML gauge programming cracks that "live" RPN to be able to correctly judge the results other than "does the gauge show up and work as expected in FS2004?" I will for the time being wait for the downloadable version. Just please let us know when that will be :)

Share this post


Link to post
Share on other sites

Would any of the HP calculators work? LOLRPN'ing since 1975!Algebric gives me the shivers!W. Sieffert

Share this post


Link to post
Share on other sites

I doubt it. Calculators go one step further and evaluate the expression numerically. Anyway the Microsoft requirements aren't strictly RPN .The way in which a value is assigned to a variable: 1 > Ai.e. assign 1 to A is still infix. The RPN equivalent should be:1 A >

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...