Displaying 1 result from an estimated 1 matches for "handlerast".
Did you mean:
handler's
2010 Sep 08
0
[LLVMdev] how to call back from JITted code to some native custom functions/variables.
..., from the design point of
view.
Imagine the following API:
class Runner {
public:
// codegen's the AST of given handler (and all referring syms)
// and executes it.
// a handler returns true when actually handled the data,
// false is returned otherwise.
bool run(Handler *handlerAST);
// registers a callback, to be invoked when a custom/native
// variable is requested.
// the type T may be double and std::string
template<typename T>
void registerNativeVariable(const std::string& symbolName,
const std::function<T()>& callback);...