Geeks With Blogs

News QTP and Stuff
Theo Moore Questions... Morphology? Longevity? Incept dates?
I have this habit of working on things that don't seem to have a lot of importance simply because I think it would be interesting. This decision almost inevitably leads to exteme frustration on my part, yet I seem to keep doing it.

My most recent decision? A math parser.

See, I want a stack screen calculator for my pocketpc...and it's been awhile since I wrote anything for the NETCF. So, seems like the thing to do. I basically need to create a parser than can evaluate an equation and return a result. I believe I understand how to do this (I looked up some documentation on how one might do this). You parse the equation into numbers and operators, starting with the inner most parentheses. The idea is that you evaluate the operators and numbers such that you can use RPN (reverse polish notation) to generate answers internally. My only problem is nested parentheses; I don't know how to handle them....unless I find the first set, sub-parse it and handle parentheses recursively....

and about then, my eyes start to cross.

Anyone worked on something like this before or can point me in the direction of how such a algorithm might be built? Posted on Monday, May 19, 2008 9:13 AM | Back to top


Comments on this post: From the "Why are you doing that files?"

# re: From the "Why are you doing that files?"
Requesting Gravatar...
Hey Theo. Sounds like an interesting side project.

I used Tamer Oz's code for parsing math expressions before. It should suit your needs IMHO... You can find his code @

http://www.codeproject.com/KB/cs/MathParserLibrary.aspx

Jonathan Starr
Left by Jonathan Starr on May 19, 2008 11:53 AM

# re: From the "Why are you doing that files?"
Requesting Gravatar...
I have the opposite,... When a task became not very challanging, I leave working on it w/o completing...
Left by Tracy on May 20, 2008 10:40 PM

# re: From the "Why are you doing that files?"
Requesting Gravatar...
I'm just glad to see Theo working on .NET CF projects again :)
Left by Lou on May 23, 2008 9:25 PM

Comments have been closed on this topic.
Copyright © Theo Moore | Powered by: GeeksWithBlogs.net