I need to pass in a string that gets evaluated at runtime. So I can write this:
var foo = someEvalMethod ( "dataObject.someValue" )
instead of:
if ( argIn == "dataObject.someValue")
var foo = dataObject.someValue
}
Does anyone have an opinion on the following evaluate libraries, or better ones for AS3? Thanks:
AS3 eval by hurlant:
http://eval.hurlant.com/
D.eval by RIA 1:
http://www.riaone.com/products/deval/
As far as I know AS3 eval by hurlant is a "real" compiler. It parses code, generates bytecode and injects it to the Flash Player instance in use (through loadBytes() I guess).
D.eval has the same purpose but it does not generate bytecode, it parses expressions and execute them dynamically through its own API.
I see D.eval as a good candidate for what you are trying to achieve. It's not a full featured compiler, but it has enough APIs that cover many simple operations. Other than that it is a product that has a company behind, which is always a good guaranty.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With