Forums Register Login

how to convert a string to a java expression ??

+Pie Number of slices to send: Send
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
I am sorry if you read this question again
+Pie Number of slices to send: Send
I don't this is possible. A JAVA expression is compiled into bytecode and evaluated by the JVM. What you're proposing to do is have a psuedo-JIT inside your code. If you figure out how, let me know!
-Peter
+Pie Number of slices to send: Send
Let's see if I can get this straight... what you are proposing is to take a String or even a whole file full of Strings and feed them into some program (let's call it javac.exe for arguments sake) and then have this javac.exe produce executable byte code? Sounds completely implausable.
+Pie Number of slices to send: Send
I'm closing this topic here, because Oni has posted it about 3 other forums.
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


Reply locked
This thread has been viewed 1442 times.
Similar Threads
how to convert a String into an expression
how to convert a String into an expression
Evaluating string expressions
SQL statement to java
how to convert a String into an expression
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:47:01.