AstTopDownProcessing< InheritedAttributeType > Class Template Reference
[AST Processing]

#include <AstProcessing.h>

Inheritance diagram for AstTopDownProcessing< InheritedAttributeType >:

Inheritance graph
[legend]
Collaboration diagram for AstTopDownProcessing< InheritedAttributeType >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class InheritedAttributeType>
class AstTopDownProcessing< InheritedAttributeType >

Attribute Evaluator for inherited attributes.

This class allows to compute inherited attributes on the AST. It requires an inherited attribute type as a template parameter and the implementation of the function evaluateInheritedAttribute. This function is invoked in pre-order while the AST is traversed. It can be used for passing context information down the AST.

For internal use only.

This class is derived from the SgTreeTraversal class.


Public Types

typedef SgTreeTraversal< InheritedAttributeType,
DummyAttribute >::SynthesizedAttributesList 
SynthesizedAttributesList

Public Member Functions

void traverse (SgNode *node, InheritedAttributeType inheritedValue)
 evaluates attributes on the entire AST
void traverseWithinFile (SgNode *node, InheritedAttributeType inheritedValue)
 evaluates attributes only at nodes which represent the same file as where the evaluation was started

Protected Member Functions

virtual InheritedAttributeType evaluateInheritedAttribute (SgNode *astNode, InheritedAttributeType inheritedValue)=0
 pure virtual function which must be implemented to compute the inherited attribute at a node
virtual void atTraversalStart ()
 Function called at the start of the traversal, before any node is visited; override if necessary, the default implementation is a no-op.
virtual void atTraversalEnd ()
virtual void destroyInheritedValue (SgNode *, InheritedAttributeType)

Private Member Functions

DummyAttribute evaluateSynthesizedAttribute (SgNode *astNode, InheritedAttributeType inheritedValue, SynthesizedAttributesList l)
DummyAttribute defaultSynthesizedAttribute (InheritedAttributeType inh)

Friends

class AstCombinedTopDownProcessing< InheritedAttributeType >
class DistributedMemoryAnalysisPreTraversal< InheritedAttributeType >


Member Typedef Documentation

template<class InheritedAttributeType>
typedef SgTreeTraversal<InheritedAttributeType, DummyAttribute>::SynthesizedAttributesList AstTopDownProcessing< InheritedAttributeType >::SynthesizedAttributesList

Reimplemented from SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.


Member Function Documentation

template<class InheritedAttributeType>
void AstTopDownProcessing< InheritedAttributeType >::traverse ( SgNode node,
InheritedAttributeType  inheritedValue 
)

evaluates attributes on the entire AST

template<class InheritedAttributeType>
void AstTopDownProcessing< InheritedAttributeType >::traverseWithinFile ( SgNode node,
InheritedAttributeType  inheritedValue 
)

evaluates attributes only at nodes which represent the same file as where the evaluation was started

template<class InheritedAttributeType>
virtual InheritedAttributeType AstTopDownProcessing< InheritedAttributeType >::evaluateInheritedAttribute ( SgNode astNode,
InheritedAttributeType  inheritedValue 
) [protected, pure virtual]

pure virtual function which must be implemented to compute the inherited attribute at a node

Implements SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.

Implemented in AstCombinedTopDownProcessing< InheritedAttributeType >, and AstCombinedTopDownProcessing< I >.

template<class InheritedAttributeType>
void AstTopDownProcessing< InheritedAttributeType >::atTraversalStart (  )  [protected, virtual]

Function called at the start of the traversal, before any node is visited; override if necessary, the default implementation is a no-op.

Reimplemented from SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.

Reimplemented in AstCombinedTopDownProcessing< InheritedAttributeType >, and AstCombinedTopDownProcessing< I >.

template<class InheritedAttributeType>
void AstTopDownProcessing< InheritedAttributeType >::atTraversalEnd (  )  [protected, virtual]

Reimplemented from SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.

Reimplemented in AstCombinedTopDownProcessing< InheritedAttributeType >, AstSharedMemoryParallelizableTopDownProcessing< InheritedAttributeType >, AstCombinedTopDownProcessing< I >, and AstSharedMemoryParallelizableTopDownProcessing< I >.

template<class InheritedAttributeType>
void AstTopDownProcessing< InheritedAttributeType >::destroyInheritedValue ( SgNode ,
InheritedAttributeType   
) [protected, virtual]

Reimplemented in AstCombinedTopDownProcessing< InheritedAttributeType >, and AstCombinedTopDownProcessing< I >.

template<class InheritedAttributeType>
DummyAttribute AstTopDownProcessing< InheritedAttributeType >::evaluateSynthesizedAttribute ( SgNode astNode,
InheritedAttributeType  inheritedValue,
SynthesizedAttributesList  l 
) [private]

template<class InheritedAttributeType>
DummyAttribute AstTopDownProcessing< InheritedAttributeType >::defaultSynthesizedAttribute ( InheritedAttributeType  inh  )  [private, virtual]

Reimplemented from SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.


Friends And Related Function Documentation

template<class InheritedAttributeType>
friend class AstCombinedTopDownProcessing< InheritedAttributeType > [friend]

template<class InheritedAttributeType>
friend class DistributedMemoryAnalysisPreTraversal< InheritedAttributeType > [friend]


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