okok, im writing a scripting language (for animations).
i can parse the code typed in and create an instruction stream from it for my VM to execute.
Now i'm writing the VM, and i need the best and fastest way of evaluating something like
x = y / (somefunc(a * b, foo))
that's just an example, but u should get what i mean
what i'm thinking is: go thru the line, and execute any functions first, then * and / then + - (from rule of order of operations in maths).
anyone have any other ideas, or any way to implement this?
i expect i can figure it out, but i'd like some other ways of doing it.




Reply With Quote