Environment Class Reference

Represents (current) binding of variables to a buffer node. More...

#include <environment.h>

Collaboration diagram for Environment:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Environment ()
 Constructor.
 Environment (BufferNode *_root)
 Constructor.
virtual ~Environment ()
void insertNodeBinding (unsigned var, BufferNode *node)
 Inserts (or sets) a new variable with its (current) binding to a BufferNode.
void print (OutputStream &dos)
 Prints all variables with their (current) binding to a BufferNode.
BufferNodegetNodeBinding (unsigned var)
 Returns the (current) binding to a BufferNode for the entered variable.
Environmentclone ()
 Returns a new, independent copy of all variables with their (current) binding to a BufferNode or of this object respectively.

Private Attributes

Env env
 The underlying map of this object.


Detailed Description

Represents (current) binding of variables to a buffer node.

Represents (current) binding of variables to a buffer node, which takes therefore a variable and a BufferNode as arguments.

Note:
Variables are internally represented by numbers!
Author:
Michael Schmidt

Gunnar Jehl

Version:
2.1
License:
Software License Agreement (BSD License)

Definition at line 60 of file environment.h.


Constructor & Destructor Documentation

Environment::Environment (  ) 

Constructor.

Constructor - creating object.

Definition at line 38 of file environment.cpp.

Referenced by clone().

Environment::Environment ( BufferNode _root  ) 

Constructor.

Constructor - creating object for a BufferNode.

Parameters:
[in] _root Pointer to a BufferNode object.

Definition at line 41 of file environment.cpp.

References env, and TAGID_ROOT.

Environment::~Environment (  )  [virtual]

Destructor.

Definition at line 45 of file environment.cpp.


Member Function Documentation

Environment * Environment::clone (  ) 

Returns a new, independent copy of all variables with their (current) binding to a BufferNode or of this object respectively.

Returns a new, independent copy of all variables with their (current) binding to a BufferNode or of this object respectively.

Return values:
Environment* Pointer to a Environment object.

Definition at line 69 of file environment.cpp.

References env, Environment(), and insertNodeBinding().

Referenced by ForExpression::eval(), and ForExpression::evalSignOffForBinding().

BufferNode * Environment::getNodeBinding ( unsigned  var  ) 

void Environment::insertNodeBinding ( unsigned  var,
BufferNode node 
)

Inserts (or sets) a new variable with its (current) binding to a BufferNode.

Inserts (or sets) a new variable with its (current) binding to a BufferNode.

Parameters:
[in] var Variable for which (current) binding holds.
[in] node Pointer to a BufferNode object.
Return values:
void 

Definition at line 48 of file environment.cpp.

References env.

Referenced by clone(), ForExpression::eval(), and ForExpression::evalSignOffForBinding().

void Environment::print ( OutputStream dos  ) 

Prints all variables with their (current) binding to a BufferNode.

Prints all variables with their (current) binding to a BufferNode.

Parameters:
[in] dos Pointer to a OutputStream object.
Return values:
void 

Definition at line 52 of file environment.cpp.

References env, VarName::getInstance(), VarName::getVarname(), and NEWLINE.


Member Data Documentation

Env Environment::env [private]

The underlying map of this object.

The underlying map of this object, which maps variables to a BufferNode.

Definition at line 118 of file environment.h.

Referenced by clone(), Environment(), getNodeBinding(), insertNodeBinding(), and print().


Generated on Sun May 24 20:20:23 2009 for G(arbage) C(ollected) X(Query) Engine by  doxygen 1.5.9