ROSE 0.11.145.147
Public Types | Public Member Functions | Protected Member Functions | List of all members
AstTopDownProcessing< InheritedAttributeType > Class Template Referenceabstract

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.

Definition at line 237 of file AstProcessing.h.

#include <AstProcessing.h>

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

Public Types

typedef SgTreeTraversal< InheritedAttributeType, DummyAttribute >::SynthesizedAttributesList SynthesizedAttributesList
 
- Public Types inherited from SgTreeTraversal< InheritedAttributeType, DummyAttribute >
typedef StackFrameVector< DummyAttribute > 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
 
- Public Member Functions inherited from SgTreeTraversal< InheritedAttributeType, DummyAttribute >
DummyAttribute traverse (SgNode *basenode, InheritedAttributeType inheritedValue, t_traverseOrder travOrder=preandpostorder)
 
DummyAttribute traverseWithinFile (SgNode *basenode, InheritedAttributeType inheritedValue, t_traverseOrder travOrder=preandpostorder)
 
void traverseInputFiles (SgProject *projectNode, InheritedAttributeType inheritedValue, t_traverseOrder travOrder=preandpostorder)
 
 SgTreeTraversal (const SgTreeTraversal &)
 
const SgTreeTraversaloperator= (const SgTreeTraversal &)
 

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)
 
- Protected Member Functions inherited from SgTreeTraversal< InheritedAttributeType, DummyAttribute >
virtual DummyAttribute evaluateSynthesizedAttribute (SgNode *n, InheritedAttributeType in, SynthesizedAttributesList l)=0
 
virtual void setNodeSuccessors (SgNode *node, SuccessorsContainer &succContainer)
 
void set_useDefaultIndexBasedTraversal (bool)
 

Additional Inherited Members

- Protected Types inherited from SgTreeTraversal< InheritedAttributeType, DummyAttribute >
typedef AstSuccessorsSelectors::SuccessorsContainer SuccessorsContainer
 
typedef SuccessorsContainer & SuccessorsContainerRef
 

Member Typedef Documentation

◆ SynthesizedAttributesList

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

Definition at line 242 of file AstProcessing.h.

Member Function Documentation

◆ traverse()

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

evaluates attributes on the entire AST

Definition at line 539 of file AstProcessing.h.

◆ traverseWithinFile()

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

Definition at line 552 of file AstProcessing.h.

◆ evaluateInheritedAttribute()

template<class InheritedAttributeType >
virtual InheritedAttributeType AstTopDownProcessing< InheritedAttributeType >::evaluateInheritedAttribute ( SgNode astNode,
InheritedAttributeType  inheritedValue 
)
protectedpure virtual

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

Implements SgTreeTraversal< InheritedAttributeType, DummyAttribute >.

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

◆ atTraversalStart()

template<class InheritedAttributeType >
void AstTopDownProcessing< InheritedAttributeType >::atTraversalStart ( )
protectedvirtual

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, DummyAttribute >.

Reimplemented in AstCombinedTopDownProcessing< InheritedAttributeType >.

Definition at line 944 of file AstProcessing.h.

◆ atTraversalEnd()

template<class InheritedAttributeType >
void AstTopDownProcessing< InheritedAttributeType >::atTraversalEnd ( )
protectedvirtual

Reimplemented from SgTreeTraversal< InheritedAttributeType, DummyAttribute >.

Definition at line 951 of file AstProcessing.h.

◆ destroyInheritedValue()

template<class InheritedAttributeType >
void AstTopDownProcessing< InheritedAttributeType >::destroyInheritedValue ( SgNode ,
InheritedAttributeType   
)
protectedvirtual

Definition at line 937 of file AstProcessing.h.


The documentation for this class was generated from the following file: