Value Struct Reference

#include <vm.h>

List of all members.


Detailed Description

Value coupled with its type.

Definition at line 37 of file vm.h.


Public Types

enum  VType {
  V_NULL = 0, V_BOOL, V_INT, V_DOUBLE,
  V_STRING
}

Public Member Functions

 Value ()
 initialize null value

Public Attributes

VType type
 value type
bool boolVal
 valid only if type == V_BOOL
int intVal
 valid only if type == V_INT
double doubleVal
 valid only if type == V_DOUBLE
std::string stringVal
 valid only if type == V_STRING

Member Enumeration Documentation

enum VType

Enumerator:
V_NULL 
V_BOOL 
V_INT 
V_DOUBLE 
V_STRING 

Definition at line 38 of file vm.h.


Constructor & Destructor Documentation

Value (  ) 

initialize null value

Definition at line 39 of file vm.cc.


Member Data Documentation

VType type

value type

Definition at line 45 of file vm.h.

Referenced by BinaryCmd::aluOp(), BinaryCmd::cmp(), CmdFactory::createAssign(), CmdFactory::createPush(), BinaryCmd::divide(), PrintCmd::exec(), WhileCmd::exec(), IfCmd::exec(), BinaryCmd::exec(), UnaryCmd::exec(), Builder::fncCall(), operator<<(), operator==(), ValueStack::popToVar(), PrintCmd::PrintCmd(), ValueStack::push(), and PrintCmd::toStream().

bool boolVal

valid only if type == V_BOOL

Definition at line 47 of file vm.h.

Referenced by WhileCmd::exec(), BinaryCmd::exec(), UnaryCmd::exec(), and operator<<().

int intVal

valid only if type == V_INT

Definition at line 48 of file vm.h.

Referenced by BinaryCmd::aluOp(), BinaryCmd::cmp(), BinaryCmd::divide(), PrintCmd::exec(), UnaryCmd::exec(), and operator<<().

double doubleVal

valid only if type == V_DOUBLE

Definition at line 49 of file vm.h.

Referenced by BinaryCmd::aluOp(), BinaryCmd::cmp(), BinaryCmd::divide(), PrintCmd::exec(), UnaryCmd::exec(), and operator<<().

std::string stringVal

valid only if type == V_STRING

Definition at line 50 of file vm.h.

Referenced by BinaryCmd::cmp(), PrintCmd::exec(), BinaryCmd::exec(), and operator<<().


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