Hi, i have a following string : "if ( ((X < 20 ) && ( Y > 50)) | | ( Z ==56) ) " i want to convert it to a java condtional expression...how can i do that ?? as a matter of fact i want to know is there any generic way to convert any string to a corresponding java expression or statement or variable declaration. thanks Oni
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
Hi, You can do it through hard work and recursive procedures ... There is no generic way to convert any string to a corresponding java expression or statement, but there is a specific way. Sun defined a way to do it. They even went so far as designing it and giving it away to the public. They even supplied a specification guide and everything! Manfred.
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
I am a bit confused (as usual). Are you looking to take in this string when you execute your code? If so you would already be past the compile point and who cares if it is a java conditional expression or not. I think that I need straightening out.....
"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: how to convert a String into an expression