Classes | Public Types | Public Member Functions

el7::scripting::RuntimeEnvironment Class Reference

#include <RuntimeEnvironment.h>

List of all members.

Classes

struct  Regs

Public Types

typedef std::vector< Value * > ValueStack
typedef std::vector< Value * > Params
typedef std::stack< RegsRegsStack

Public Member Functions

 RuntimeEnvironment (VirtualMachine *vm)
 RuntimeEnvironment (RuntimeEnvironment *super_env, bool cascading)
 ~RuntimeEnvironment (void)
VirtualMachineget_vm () const
RuntimeEnvironmentget_global_env () const
RuntimeEnvironmentget_super_env () const
bool is_global () const
bool is_local () const
bool is_cascading () const
const ValueMapget_value_map () const
ValueMapget_value_map ()
void push_regs_stack ()
void pop_regs_stack ()
void clear_regs_stack ()
bool has_params () const
const Paramsget_params () const
void add_param (Value *value)
void clear_params ()
unsigned get_value_count () const
Valueget_value ()
Valueget_value (unsigned i)
void push_value (Value *value)
Valuepop_value ()
void clear_values ()
Valuefind_value (const Symbol symbol) const

Detailed Description

Represents a runtime environment holding the current or temporary state of a (nested) script.


Member Typedef Documentation


Constructor & Destructor Documentation

el7::scripting::RuntimeEnvironment::RuntimeEnvironment ( VirtualMachine vm  ) 

Explicit constructor.

el7::scripting::RuntimeEnvironment::RuntimeEnvironment ( RuntimeEnvironment super_env,
bool  cascading 
)

Explicit constructor.

el7::scripting::RuntimeEnvironment::~RuntimeEnvironment ( void   ) 

Destructor.


Member Function Documentation

void el7::scripting::RuntimeEnvironment::add_param ( Value value  ) 

Adds a parameter.

void el7::scripting::RuntimeEnvironment::clear_params (  ) 

Clears the parameters.

void el7::scripting::RuntimeEnvironment::clear_regs_stack (  ) 

Clears the register stack.

void el7::scripting::RuntimeEnvironment::clear_values (  ) 

Clears the stack of remaining (interim) value objects.

Value * el7::scripting::RuntimeEnvironment::find_value ( const Symbol  symbol  )  const

Searches for the value object of a given symbol within this (local) runtime environment. If the symbol is not found and this runtime environment is cascading, the superior runtime environment is asked for the symbol's value object. If this runtime environment is not cascading or the symbel is not found within it or one of the superior runtime environments, the global runtime environment is asked for the symbol's value object. If the symbol can not be found at all, the function returns null, a pointer to the value object otherwise.

RuntimeEnvironment* el7::scripting::RuntimeEnvironment::get_global_env (  )  const [inline]

Returns the global runtime environment (NULL, if this runtime environment is global).

const RuntimeEnvironment::Params * el7::scripting::RuntimeEnvironment::get_params (  )  const

Returns the parameters.

RuntimeEnvironment* el7::scripting::RuntimeEnvironment::get_super_env (  )  const [inline]

Returns the superior runtime environment (NULL, if this runtime environment is global).

Value * el7::scripting::RuntimeEnvironment::get_value (  ) 

Returns the (interim) value object on top of the stack.

Value * el7::scripting::RuntimeEnvironment::get_value ( unsigned  i  ) 

Returns the i-th (interim) value object on top of the stack.

unsigned el7::scripting::RuntimeEnvironment::get_value_count (  )  const [inline]

Returns the number of (interim) value objects on the stack.

ValueMap* el7::scripting::RuntimeEnvironment::get_value_map (  )  [inline]

Returns the symbol-to-value-map.

const ValueMap* el7::scripting::RuntimeEnvironment::get_value_map (  )  const [inline]

Returns the symbol-to-value-map.

VirtualMachine* el7::scripting::RuntimeEnvironment::get_vm (  )  const [inline]

Returns the all managing virtual machine.

bool el7::scripting::RuntimeEnvironment::has_params (  )  const

Returns true, if at least one parameter has been added.

bool el7::scripting::RuntimeEnvironment::is_cascading (  )  const [inline]

Returns the flag specifying whether this runtime environment allows access to superior runtime environments.

bool el7::scripting::RuntimeEnvironment::is_global (  )  const [inline]

Returns true, if this runtime environment is global, false otherwise.

bool el7::scripting::RuntimeEnvironment::is_local (  )  const [inline]

Returns true, if this runtime environment is not global, false otherwise.

void el7::scripting::RuntimeEnvironment::pop_regs_stack (  ) 

Pops the register stack.

Value * el7::scripting::RuntimeEnvironment::pop_value (  ) 

Pops and returns the top (interim) value object from the stack.

void el7::scripting::RuntimeEnvironment::push_regs_stack (  ) 

Pushes the register stack.

void el7::scripting::RuntimeEnvironment::push_value ( Value value  ) 

Adds the given (interim) value object at the top of the stack.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines