June 2nd, 2010, 04:05 PM
Custom expression evaluator in C++
I am trying to make something which can load an expression with custom definitions to functions. An example what I would like:
Mouse.x() * 5
2+(Keyboard.A() * Object.Val(0))
mouse is an object and x is a function in that object to call. Functions may also have parameters of varying types and quantities.
I wish to run through the events frequently, so what I am looking for is a way to decode the expressions at run time and store it in a way that allows me to process them faster, without the need to parse each expression every time. Perhaps by somehow storing pointers to functions once they have been decoded?
I am finding this problem quite hard to resolve so help would be much appreciated
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.