FncSet Class Reference

#include <vm.h>

Collaboration diagram for FncSet:

Collaboration graph
[legend]

List of all members.


Detailed Description

universal container for fnc declarations/definitions
Attention:
The container is responsible to delete all successfully added objects.

Definition at line 179 of file vm.h.


Public Types

typedef const FncDefinition ** TVector
 vector of pointers to function definitions

Public Member Functions

 FncSet ()
 ~FncSet ()
bool addDeclaration (FncDeclaration *)
FncDeclarationgetDeclaration (const std::string &)
bool addDefinition (FncDefinition *)
FncDefinitiongetDefinition (const std::string &)
void getAllDefinitions (TVector &)

Private Attributes

Privated

Classes

struct  Private

Member Typedef Documentation

typedef const FncDefinition* * TVector

vector of pointers to function definitions

Definition at line 212 of file vm.h.


Constructor & Destructor Documentation

FncSet (  ) 

Definition at line 383 of file vm.cc.

~FncSet (  ) 

Definition at line 388 of file vm.cc.

References d, FncSet::Private::declMap, and FncSet::Private::defMap.


Member Function Documentation

bool addDeclaration ( FncDeclaration decl  ) 

add declaration to container If declaration with the same name exists, check if not differs.

Returns:
Return true on success.

Definition at line 404 of file vm.cc.

References d, FncSet::Private::declMap, Var::name, and FncDeclaration::self.

Referenced by Builder::fncDecl(), Builder::fncDefBody(), and FncFactory::initVm().

Here is the caller graph for this function:

FncDeclaration * getDeclaration ( const std::string &  name  ) 

function declaration lookup

Returns:
Return pointer to declaration if found, NULL otherwise.

Definition at line 420 of file vm.cc.

References d, and FncSet::Private::declMap.

Referenced by VmRunner::Private::chkFncRefs(), Builder::fncCall(), Builder::fncDecl(), and Builder::fncDefBody().

Here is the caller graph for this function:

bool addDefinition ( FncDefinition def  ) 

add definition to container If definition with the same name already exists, return false. If declaration with the same name exists, check if not differs.

Returns:
Return true on success.

Definition at line 428 of file vm.cc.

References chkUnused(), d, FncSet::Private::declMap, FncSet::Private::defMap, Var::name, and FncDeclaration::self.

Referenced by FncFactory::Private::addDefinition(), and Builder::fncDef().

Here is the call graph for this function:

Here is the caller graph for this function:

FncDefinition * getDefinition ( const std::string &  name  ) 

function definition lookup

Returns:
Return pointer to definition if found, NULL otherwise.

Definition at line 454 of file vm.cc.

References d, and FncSet::Private::defMap.

Referenced by VmRunner::Private::chkFncRefs(), CallCmd::exec(), and Builder::fncDefBody().

Here is the caller graph for this function:

void getAllDefinitions ( TVector fncVect  ) 

collect pointer to all definition stored in container

Note:
useful to find unused functions
Returns:
vector of pointers to definitions (not cloned)

Definition at line 462 of file vm.cc.

References d, and FncSet::Private::defMap.


Member Data Documentation

Private* d [private]

Definition at line 221 of file vm.h.

Referenced by addDeclaration(), addDefinition(), getAllDefinitions(), getDeclaration(), getDefinition(), and ~FncSet().


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