How to transform string into expression?

Hi! =] I'm trying to create very easy application. Main goal is that user input two numbers (actually they may be expressions) and application outputs the highest value after expression is ran. Problem starts when I get to expressions. I save inputed values as strings and then I want to somehow force them to ran as expressions.

For example:

x = 23 - 2
y = ( 76 + 4 ) * 4

Any ideas??

I got so far... http://pastie.org/1508760
You need to parse the expressions and evaluate the result. It's not “very easy” but not even much difficult.
The easiest way to do so is with a recursive descent parser.
If you don't know what a “recursive descent parser” is you should just stick to numbers
Thanks for ur answer, Bazzy. =]
I will better learn what the “recursive descent parser” is and then finish this task. =P
Topic archived. No new replies allowed.