ValueStack Class Reference

#include <vm.h>

Collaboration diagram for ValueStack:

Collaboration graph
[legend]

List of all members.


Detailed Description

stack for Value objects
Note:
also called vmStack in Vm terminology

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

Privated

Classes

struct  Private

Constructor & Destructor Documentation

ValueStack ( Vm vm  ) 

related virtual machine

Definition at line 130 of file vm.cc.

~ValueStack (  ) 

Definition at line 134 of file vm.cc.

References d.


Member Function Documentation

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

bool push ( PValue  val,
const Token t 
)

high-level push

Note:
may print Token-related error messages
Returns:
Return true on success

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.

Here is the call graph for this function:

bool pushFromVar ( const Var var,
const Token t 
)

high-level push from variable check if variable is initialized, etc.

Note:
may print Token-related error messages
Returns:
Return true on success

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().

Here is the call graph for this function:

Here is the caller graph for this function:

bool pop ( PValue val,
const Token t 
)

high-level pop

Note:
may print Token-related error messages
Returns:
Return true on success

Definition at line 183 of file vm.cc.

References d, StreamDecorator::E_ERROR, Vm::fileName, isEmpty(), pop(), ValueStack::Private::vm, and Vm::vmStack.

Here is the call graph for this function:

bool popToVar ( Var var,
const Token t 
)

high-level pop to variable mark variable as initialized, etc.

Note:
may print Token-related error messages
Returns:
Return true on success

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Private* d [private]

Definition at line 304 of file vm.h.

Referenced by isEmpty(), pop(), popToVar(), push(), pushFromVar(), and ~ValueStack().


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