BinaryCmd Class Reference

Inheritance diagram for BinaryCmd:

Inheritance graph
[legend]
Collaboration diagram for BinaryCmd:

Collaboration graph
[legend]

List of all members.


Detailed Description

perform binary operator operation on vmStack

Definition at line 146 of file cmd.cc.


Public Member Functions

 BinaryCmd (const Token &t)
virtual void toStream (std::ostream &str) const
 dump command to stream in human-readable format
virtual bool exec (FncDefinition *fnc)
 execute command in the context of calling function
bool chkTypes (Value::VType, Value::VType)

Private Member Functions

int cmp (PConstValue, PConstValue)
void aluOp (PValue, PConstValue)
bool divide (PValue, PConstValue)

Private Attributes

Token t_

Constructor & Destructor Documentation

BinaryCmd ( const Token t  )  [inline]

Definition at line 148 of file cmd.cc.

References t_, and Token::text.


Member Function Documentation

virtual void toStream ( std::ostream &   )  const [inline, virtual]

dump command to stream in human-readable format

Implements ICmd.

Definition at line 153 of file cmd.cc.

References StreamDecorator::C_LIGHT_CYAN, StreamDecorator::C_NO_COLOR, and t_.

bool exec ( FncDefinition  )  [virtual]

execute command in the context of calling function

Implements ICmd.

Definition at line 661 of file cmd.cc.

References aluOp(), Value::boolVal, chkTypes(), cmp(), ValueFactory::create(), divide(), StreamDecorator::E_ERROR, StreamDecorator::E_NOTE, 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, ValueStack::pop(), ValueStack::push(), Value::stringVal, t_, Token::type, Value::type, Value::V_STRING, and Vm::vmStack.

Here is the call graph for this function:

bool chkTypes ( Value::VType  t1,
Value::VType  t2 
)

Definition at line 556 of file cmd.cc.

References 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, t_, Token::type, Value::V_BOOL, Value::V_DOUBLE, Value::V_INT, and Value::V_STRING.

Referenced by exec().

Here is the caller graph for this function:

int cmp ( PConstValue  val1,
PConstValue  val2 
) [private]

Definition at line 599 of file cmd.cc.

References Value::doubleVal, Value::intVal, Value::stringVal, Value::type, Value::V_DOUBLE, and Value::V_STRING.

Referenced by exec().

Here is the caller graph for this function:

void aluOp ( PValue  dst,
PConstValue  src 
) [private]

Definition at line 615 of file cmd.cc.

References Value::doubleVal, ETOKEN_OP_MINUS, ETOKEN_OP_PLUS, ETOKEN_OP_STAR, Value::intVal, t_, Token::type, Value::type, Value::V_DOUBLE, and Value::V_INT.

Referenced by exec().

Here is the caller graph for this function:

bool divide ( PValue  dst,
PConstValue  src 
) [private]

Definition at line 642 of file cmd.cc.

References Value::doubleVal, ETOKEN_KW_DIV, Value::intVal, t_, Token::type, Value::type, Value::V_DOUBLE, and Value::V_INT.

Referenced by exec().

Here is the caller graph for this function:


Member Data Documentation

Token t_ [private]

Definition at line 160 of file cmd.cc.

Referenced by aluOp(), BinaryCmd(), chkTypes(), divide(), exec(), and toStream().


The documentation for this class was generated from the following file:
Generated on Sat Jul 4 18:33:04 2009 for vyp08 (compiler and interpreter of VYP08 language) by  doxygen 1.5.4