ug4
|
--> documentation in vm.doxygen <–/// More...
#include <vm.h>
Public Member Functions | |
void | adjust_jmp_pos (int iPos, int jmpPos) |
void | assign (int v) |
void | binary (int oper) |
double | call () |
double | call (double *stack, int &SP) |
double | call (double a) |
double | call (double a, double b) |
double | call (double a, double b, double c) |
void | call (SmartPtr< VMAdd > subfunction) |
double | call_sub (double *stack, int &SP) |
int | execute (double *ret, const double *in) |
void | execute_binary (size_t &i, double *stack, int SP) |
void | execute_unary (size_t &i, double &v) |
int | get_pos () |
int | jmp () |
int | jmp_if_false () |
int | jump (VMInstruction instr) |
size_t | num_in () |
size_t | num_out () |
void | print () |
void | print_rec (int level) |
void | print_short () |
void | push (double constant) |
void | push_var (int i) |
void | ret () |
void | set_in_out (size_t nrIn, size_t nrOut) |
void | set_name (std::string name) |
void | set_nr_of_variables (size_t nr) |
void | unary (int oper) |
VMAdd () | |
Private Types | |
enum | VMInstruction { PUSH_CONSTANT =0 , PUSH_VAR , JMP_IF_FALSE , JMP , OP_UNARY , OP_BINARY , ASSIGN , OP_RETURN , OP_CALL } |
Private Member Functions | |
void | deserializeDouble (size_t &p, double &d) |
void | deserializeInt (size_t &p, int &i) |
void | deserializeVMInstr (size_t &p, VMInstruction &instr) |
void | print_op (size_t &i) |
void | print_unaryDouble (const char *desc, size_t &i) |
void | print_unaryInt (const char *desc, size_t &i) |
void | serializeChar (char c) |
void | serializeDouble (double d) |
void | serializeInt (int d) |
void | serializeVMInstr (VMInstruction inst) |
Private Attributes | |
std::string | m_name |
size_t | m_nrIn |
size_t | m_nrOut |
std::vector< SmartPtr< VMAdd > > | subfunctions |
std::vector< double > | variables |
std::vector< char > | vmBuf |
--> documentation in vm.doxygen <–///
|
private |
|
inline |
References m_name.
|
inline |
Referenced by ug::LUAParserClass::createVM().
|
inline |
References ASSIGN, and serializeInt().
Referenced by ug::LUAParserClass::createVM().
|
inline |
References OP_BINARY, and serializeInt().
Referenced by ug::LUAParserClass::createVM().
|
inline |
Referenced by call(), call_sub(), and execute().
|
inline |
References ASSIGN, deserializeDouble(), deserializeInt(), deserializeVMInstr(), execute_binary(), execute_unary(), JMP, JMP_IF_FALSE, m_nrOut, OP_BINARY, OP_CALL, OP_RETURN, OP_UNARY, PUSH_CONSTANT, PUSH_VAR, subfunctions, UG_ASSERT, and variables.
|
inline |
|
inline |
|
inline |
References OP_CALL, serializeInt(), and subfunctions.
Referenced by ug::LUAParserClass::createVM().
|
inline |
|
inlineprivate |
Referenced by call(), and print_unaryDouble().
|
inlineprivate |
Referenced by call(), execute_binary(), execute_unary(), print_op(), print_rec(), and print_unaryInt().
|
inlineprivate |
Referenced by call(), and print_rec().
|
inline |
|
inline |
References deserializeInt(), LUAPARSER_AND, LUAPARSER_EQ, LUAPARSER_GE, LUAPARSER_LE, LUAPARSER_MATH_MAX, LUAPARSER_MATH_MIN, LUAPARSER_MATH_POW, LUAPARSER_NE, and LUAPARSER_OR.
Referenced by call().
|
inline |
References deserializeInt(), LUAPARSER_MATH_ABS, LUAPARSER_MATH_CEIL, LUAPARSER_MATH_COS, LUAPARSER_MATH_EXP, LUAPARSER_MATH_FLOOR, LUAPARSER_MATH_LOG, LUAPARSER_MATH_LOG10, LUAPARSER_MATH_SIN, and LUAPARSER_MATH_SQRT.
Referenced by call().
|
inline |
References vmBuf.
Referenced by ug::LUAParserClass::createVM(), and jump().
|
inline |
Referenced by ug::LUAParserClass::createVM().
|
inline |
References JMP_IF_FALSE, and jump().
Referenced by ug::LUAParserClass::createVM().
|
inline |
References get_pos(), serializeInt(), and serializeVMInstr().
Referenced by jmp(), and jmp_if_false().
|
inline |
References m_nrIn.
|
inline |
References m_nrOut.
|
inline |
References print_rec().
Referenced by ug::bridge::convertVM().
|
inlineprivate |
References deserializeInt(), LUAPARSER_AND, LUAPARSER_EQ, LUAPARSER_GE, LUAPARSER_LE, LUAPARSER_MATH_ABS, LUAPARSER_MATH_CEIL, LUAPARSER_MATH_COS, LUAPARSER_MATH_EXP, LUAPARSER_MATH_FLOOR, LUAPARSER_MATH_LOG, LUAPARSER_MATH_LOG10, LUAPARSER_MATH_MAX, LUAPARSER_MATH_MIN, LUAPARSER_MATH_POW, LUAPARSER_MATH_SIN, LUAPARSER_MATH_SQRT, LUAPARSER_NE, LUAPARSER_OR, and UG_LOG.
Referenced by print_rec().
|
inline |
References ASSIGN, deserializeInt(), deserializeVMInstr(), JMP, JMP_IF_FALSE, m_name, OP_BINARY, OP_CALL, OP_RETURN, OP_UNARY, print_op(), print_short(), print_unaryDouble(), print_unaryInt(), PUSH_CONSTANT, PUSH_VAR, subfunctions, UG_ASSERT, UG_COND_THROW, UG_LOG, and vmBuf.
Referenced by print().
|
inline |
References m_name, m_nrIn, m_nrOut, subfunctions, UG_LOG, and variables.
Referenced by print_rec().
|
inlineprivate |
References deserializeDouble(), and UG_LOG.
Referenced by print_rec().
|
inlineprivate |
References deserializeInt(), and UG_LOG.
Referenced by print_rec().
|
inline |
References PUSH_CONSTANT, serializeDouble(), and serializeInt().
Referenced by ug::LUAParserClass::createVM().
|
inline |
References PUSH_VAR, and serializeInt().
Referenced by ug::LUAParserClass::createVM().
|
inline |
References OP_RETURN, and serializeInt().
Referenced by ug::LUAParserClass::createVM(), and execute().
|
inlineprivate |
References vmBuf.
Referenced by serializeDouble(), and serializeInt().
|
inlineprivate |
References serializeChar().
Referenced by push().
|
inlineprivate |
References serializeChar().
Referenced by assign(), binary(), call(), jump(), push(), push_var(), ret(), serializeVMInstr(), and unary().
|
inlineprivate |
References serializeInt().
Referenced by jump().
|
inline |
References m_nrIn, and m_nrOut.
Referenced by ug::LUAParserClass::createVMHeader().
|
inline |
Referenced by ug::LUAParserClass::createVM().
|
inline |
References variables.
Referenced by ug::LUAParserClass::createVMHeader().
|
inline |
References OP_UNARY, and serializeInt().
Referenced by ug::LUAParserClass::createVM().
|
private |
Referenced by print_rec(), print_short(), set_name(), and VMAdd().
|
private |
Referenced by call(), call_sub(), execute(), num_in(), print_short(), and set_in_out().
|
private |
Referenced by call(), execute(), num_out(), print_short(), and set_in_out().
Referenced by call(), print_rec(), and print_short().
|
private |
Referenced by call(), call_sub(), execute(), print_short(), and set_nr_of_variables().
|
private |
Referenced by adjust_jmp_pos(), deserializeDouble(), deserializeInt(), deserializeVMInstr(), get_pos(), print_rec(), and serializeChar().