#include <cmd.h>
Definition at line 30 of file cmd.h.
Public Types | ||||
typedef Value::VType | VType | |||
using Value::VType for type specification | ||||
Public Member Functions | ||||
CmdFactory (Vm *vm) | ||||
| ||||
~CmdFactory () | ||||
PCmd | createAssign (Token, FncDefinition *, VType &dstType) | |||
assignment | ||||
PCmd | createIf (Token, PCmd ifCmd, PCmd elseCmd) | |||
if statement | ||||
PCmd | createWhile (Token, PCmd whileExpr, PCmd whileStat) | |||
while statement | ||||
PCmd | createPush (Token, FncDefinition *, VType &dstType) | |||
read value (and push to stack) | ||||
PCmd | createUnary (Token) | |||
unary operator | ||||
PCmd | createBinary (Token, VType t1, VType t2, VType &dstType) | |||
binary operator | ||||
PCmd | createCall (Token, unsigned nArgs, bool pushResult) | |||
function call | ||||
PCmd | createPrint (Token, EToken valType, VType &srcType) | |||
print() function | ||||
PCmd | createInput (Token, Value::VType type, bool pushResult) | |||
intput{int|double|string}() function | ||||
Private Attributes | ||||
Private * | d | |||
Classes | ||||
struct | Private |
typedef Value::VType VType |
CmdFactory | ( | Vm * | vm | ) |
~CmdFactory | ( | ) |
PCmd createAssign | ( | Token | token, | |
FncDefinition * | fnc, | |||
VType & | dstType | |||
) |
assignment
Definition at line 292 of file cmd.cc.
References FncDeclaration::args, d, StreamDecorator::E_ERROR, ETOKEN_ID, Vm::fileName, Vm::glVars, Var::name, FncDeclaration::self, Token::text, Value::type, Token::type, Value::V_NULL, Var::value, FncDefinition::vars, and CmdFactory::Private::vm.
Referenced by Builder::assign().
if statement
Definition at line 398 of file cmd.cc.
Referenced by Builder::ifLeave().
while statement
Definition at line 402 of file cmd.cc.
Referenced by Builder::whileLeave().
PCmd createPush | ( | Token | token, | |
FncDefinition * | fnc, | |||
VType & | dstType | |||
) |
read value (and push to stack)
Definition at line 336 of file cmd.cc.
References FncDeclaration::args, ValueFactory::create(), d, StreamDecorator::E_ERROR, ETOKEN_ID, ETOKEN_NUMBER_DOUBLE, ETOKEN_NUMBER_INT, ETOKEN_STRING, Vm::fileName, Vm::glVars, Var::name, Token::numberDouble, Token::numberInt, FncDeclaration::self, Token::text, Value::type, Token::type, Var::used, Value::V_DOUBLE, Value::V_INT, Value::V_NULL, Value::V_STRING, Var::value, FncDefinition::vars, and CmdFactory::Private::vm.
Referenced by Builder::pushToken().
unary operator
Definition at line 406 of file cmd.cc.
References d, StreamDecorator::E_ERROR, ETOKEN_KW_NOT, ETOKEN_OP_MINUS, Vm::fileName, Token::type, and CmdFactory::Private::vm.
Referenced by Builder::evalUnOp().
binary operator
Definition at line 417 of file cmd.cc.
References d, StreamDecorator::E_ERROR, ETOKEN_KW_AND, ETOKEN_KW_DIV, ETOKEN_KW_EQ, ETOKEN_KW_NEQ, ETOKEN_KW_OR, ETOKEN_OP_GREATER, ETOKEN_OP_GREATER_EQ, ETOKEN_OP_LESS, ETOKEN_OP_LESS_EQ, ETOKEN_OP_MINUS, ETOKEN_OP_PLUS, ETOKEN_OP_SLASH, ETOKEN_OP_STAR, Vm::fileName, SHARED_PTR, Token::type, Value::V_BOOL, Value::V_DOUBLE, Value::V_INT, Value::V_NULL, Value::V_STRING, and CmdFactory::Private::vm.
Referenced by Builder::evalBinOp().
function call
Definition at line 487 of file cmd.cc.
Referenced by Builder::fncCall(), and VmRunner::Private::run().
print() function
Definition at line 491 of file cmd.cc.
References d, StreamDecorator::E_ERROR, ETOKEN_KW_DOUBLE, ETOKEN_KW_INT, ETOKEN_KW_STRING, Vm::fileName, Value::V_DOUBLE, Value::V_INT, Value::V_STRING, and CmdFactory::Private::vm.
Referenced by Builder::fncCallPrint().
PCmd createInput | ( | Token | token, | |
Value::VType | type, | |||
bool | pushResult | |||
) |
intput{int|double|string}() function
Definition at line 511 of file cmd.cc.
Referenced by Builder::fncCall().
Definition at line 48 of file cmd.h.
Referenced by createAssign(), createBinary(), createPrint(), createPush(), createUnary(), and ~CmdFactory().