37#ifndef H_OGF_GOM_LUA_INTERPRETER_H
38#define H_OGF_GOM_LUA_INTERPRETER_H
42#include <OGF/gom/types/callable.h>
80 const std::string& command,
bool save_in_history,
bool log
91 Any resolve(
const std::string&
id,
bool quiet=
true)
const override;
96 void bind(
const std::string&
id,
const Any& value)
override;
102 const std::string& expression,
bool quiet=
true
126 void list_names(std::vector<std::string>& names)
const override;
132 Object* target,
const std::string& slot_name,
const ArgList& args
139 Object* target,
const std::string& prop_name,
const Any& value
171 const std::string& haystack_name,
188 const std::string& context, std::vector<std::string>& keys
195 const std::string& args
200 lua_State* lua_state_;
A class that stores a variable of arbitrary type.
Represents a list of name-value pairs.
Abstract base class for the GOM interpreter.
The main class that interfaces the Python interpreter with Graphite.
std::string recursive_back_resolve(Object *haystack, const std::string &haystack_name, Object *needle) const
This function recursively tracks all possible references from an object until it finds another object...
void record_set_property_in_history(Object *target, const std::string &prop_name, const Any &value) override
Records a property modification.
void get_keys(const std::string &context, std::vector< std::string > &keys) override
Gets all possible keys in a certain context.
void record_invoke_in_history(Object *target, const std::string &slot_name, const ArgList &args) override
Record an object invokation to history.
~LuaInterpreter() override
LuaInterpreter destructor.
bool execute(const std::string &command, bool save_in_history, bool log) override
Executes a single line of code in the interpreted language.
std::string name_value_pair_call(const std::string &args) const override
Transforms a list of name-value pairs arguments.
std::string back_resolve(Object *object) const override
finds how to refer to an object in the interpreter
lua_State * lua_state()
Gets the LUA state.
void reset() override
Clears all variables, restarts from initial state.
LuaInterpreter()
LuaInterpreter constructor.
void bind(const std::string &id, const Any &value) override
Binds a value to a variable.
std::string back_parse(const Any &value, MetaType *mtype=nullptr) const override
finds how to refer to an object in the interpreter
Any resolve(const std::string &id, bool quiet=true) const override
Finds a variable by id.
virtual void adjust_lua_state()
Adjusts LUA state to recover from errors.
bool execute_file(const std::string &file_name) override
Executes commands from a given file.
Any eval(const std::string &expression, bool quiet=true) const override
Evaluates a string with an expression.
void list_names(std::vector< std::string > &names) const override
Lists the variable names in this Scope.
static void display_error_message(const std::string &msg)
Displays a Lua error message.
Base class for all objects in the GOM system.
The abstract base class for the GOM interpreter.
Global Graphite namespace.
Definitions common to all include files in the gom library.