SgCopyHelp Class Reference

#include <Cxx_Grammar.h>

Inheritance diagram for SgCopyHelp:

Inheritance graph
[legend]
List of all members.

Detailed Description

Supporting class from copy mechanism within ROSE.

This class forms a base class for the SgShallowCopy and SgTreeCopy classes to support the control of copying of subtrees (what IR nodes are copied by a deep or shallow copy).

To tailor a specific type of copy operation derive a class from this abstract class and define the clone_node function as required. context information if required muyst be obtained through local analysis inside the function using the parent or scope information at each IR node.

Note:
This is an abstract class.

For internal use only.

Used in ROSETTA generated copy functions on each IR node. The location of this code should perhaps be changed to be in the generate copy code rather than Node.code in ROSETTA/Grammar.


Public Types

typedef std::map< const SgNode *,
SgNode * > 
copiedNodeMapType
typedef copiedNodeMapType::iterator copiedNodeMapTypeIterator

Public Member Functions

virtual SgNodecopyAst (const SgNode *n)=0
 SgCopyHelp ()
virtual ~SgCopyHelp ()
int get_depth ()
void incrementDepth ()
void decrementDepth ()
copiedNodeMapTypeget_copiedNodeMap ()
void clearState ()
void insertCopiedNodePair (const SgNode *key, SgNode *value)

Private Attributes

int depth
 This data member records the depth of the traversal (root node == 0).
copiedNodeMapType copiedNodeMap
 This is internal state used to asscociate pairs of IR nodes copied instead of shared.


Member Typedef Documentation

typedef std::map<const SgNode*,SgNode*> SgCopyHelp::copiedNodeMapType

typedef copiedNodeMapType::iterator SgCopyHelp::copiedNodeMapTypeIterator


Constructor & Destructor Documentation

SgCopyHelp::SgCopyHelp (  )  [inline]

virtual SgCopyHelp::~SgCopyHelp (  )  [inline, virtual]


Member Function Documentation

virtual SgNode* SgCopyHelp::copyAst ( const SgNode n  )  [pure virtual]

Implemented in SgShallowCopy, and SgTreeCopy.

int SgCopyHelp::get_depth (  )  [inline]

void SgCopyHelp::incrementDepth (  )  [inline]

void SgCopyHelp::decrementDepth (  )  [inline]

copiedNodeMapType& SgCopyHelp::get_copiedNodeMap (  )  [inline]

void SgCopyHelp::clearState (  )  [inline]

void SgCopyHelp::insertCopiedNodePair ( const SgNode key,
SgNode value 
)


Member Data Documentation

int SgCopyHelp::depth [private]

This data member records the depth of the traversal (root node == 0).

copiedNodeMapType SgCopyHelp::copiedNodeMap [private]

This is internal state used to asscociate pairs of IR nodes copied instead of shared.


The documentation for this class was generated from the following file:
Generated on Tue Jan 31 05:39:12 2012 for ROSE by  doxygen 1.4.7