#include <vm.h>
Definition at line 264 of file vm.h.
Public Member Functions | |
ValueStack (Vm *vm) | |
related virtual machine | |
~ValueStack () | |
bool | isEmpty () const |
true if stack is empty | |
void | push (PValue) |
push Value object to stack | |
PValue | pop () |
pop Value object from stack, or NULL if stack is empty | |
bool | push (PValue, const Token &) |
bool | pushFromVar (const Var &, const Token &) |
bool | pop (PValue &, const Token &) |
bool | popToVar (Var &, const Token &) |
Private Attributes | |
Private * | d |
Classes | |
struct | Private |
ValueStack | ( | Vm * | vm | ) |
~ValueStack | ( | ) |
bool isEmpty | ( | ) | const |
true if stack is empty
Definition at line 137 of file vm.cc.
References d, and ValueStack::Private::st.
Referenced by pop(), and VmRunner::Private::run().
void push | ( | PValue | val | ) |
push Value object to stack
Definition at line 141 of file vm.cc.
References StreamDecorator::C_LIGHT_PURPLE, StreamDecorator::C_NO_COLOR, d, and ValueStack::Private::st.
Referenced by InputCmd::exec(), BinaryCmd::exec(), UnaryCmd::exec(), PushValueCmd::exec(), push(), and pushFromVar().
PValue pop | ( | ) |
pop Value object from stack, or NULL if stack is empty
Definition at line 149 of file vm.cc.
References StreamDecorator::C_LIGHT_PURPLE, StreamDecorator::C_NO_COLOR, d, and ValueStack::Private::st.
Referenced by WhileCmd::exec(), IfCmd::exec(), BinaryCmd::exec(), UnaryCmd::exec(), pop(), and popToVar().
high-level push
Definition at line 162 of file vm.cc.
References d, StreamDecorator::E_ERROR, Vm::fileName, push(), Value::type, Value::V_NULL, ValueStack::Private::vm, and Vm::vmStack.
high-level push from variable check if variable is initialized, etc.
Definition at line 172 of file vm.cc.
References d, Var::defined, StreamDecorator::E_ERROR, StreamDecorator::E_NOTE, Vm::fileName, Var::initialized, push(), Var::value, and ValueStack::Private::vm.
Referenced by CallCmd::exec(), ArgCmd::exec(), LcVarCmd::exec(), GlVarCmd::exec(), and ReturnCmd::exec().
high-level pop
Definition at line 183 of file vm.cc.
References d, StreamDecorator::E_ERROR, Vm::fileName, isEmpty(), pop(), ValueStack::Private::vm, and Vm::vmStack.
high-level pop to variable mark variable as initialized, etc.
Definition at line 194 of file vm.cc.
References d, StreamDecorator::E_ERROR, StreamDecorator::E_NOTE, Vm::fileName, Var::initialized, pop(), Value::type, Var::value, and ValueStack::Private::vm.
Referenced by CallCmd::exec(), PrintCmd::exec(), ArgCmd::exec(), LcVarCmd::exec(), GlVarCmd::exec(), and ReturnCmd::exec().
Definition at line 304 of file vm.h.
Referenced by isEmpty(), pop(), popToVar(), push(), pushFromVar(), and ~ValueStack().