41 void DoAddGlobal(
const char *classname,
const char *
name, uint8_t *data);
50 template <
typename TObj>
52 DoAddGlobal(std::string(type_name<TObj>()).c_str(), name, (uint8_t*)
object);
58 #define DECLARE_ADDGLOBAL_SPECIAL(type) \
60 void uscript::VM::AddGlobal<type>(const char *name, const type *obj)
68 #undef DECLARE_ADDGLOBAL_SPECIAL
void SetChunk(const Chunk *_chunk)
void RuntimeError(const char *format,...)
std::vector< Value > stack
DECLARE_ADDGLOBAL_SPECIAL(int)
static std::string format(PyObject *obj, unsigned int pos, unsigned int indent, unsigned int maxlen, unsigned int depth)
const std::string instance
bool AccessValue(Value instance, const char *name, Value *result)
void DoAddGlobal(const char *classname, const char *name, uint8_t *data)
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
InterpretResult Interpret(const char *source)
bool GetTField(ObjTInstance instance, const char *name, Value *ret)
Value Peek(unsigned distance=0)
InterpretResult Run(Value *ret=NULL)
void AddGlobal(const char *name, const TObj *object)
uint8_t ReadInstruction()
Value GetTValue(uint8_t *loc, TData data)
bool CallValue(Value callee, int argCount)
std::map< const char *, Value > globals
bool IndexValue(Value callee, int index)