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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...