AstSimpleProcessing Class Reference
[AST Processing]

#include <AstSimpleProcessing.h>

Inheritance diagram for AstSimpleProcessing:

Inheritance graph
[legend]
Collaboration diagram for AstSimpleProcessing:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class for traversing the AST.

Todo:
Make options 'preorder' and 'postorder' local to the class (will brake user code).
This class allows to traverse the AST in preorder or postorder. A visit function must be implemented by the user which is automaticly called by the provided AST traversal.

For internal use only.

This class is derived from the SgTreeTraversal class.


Public Types

typedef t_traverseOrder Order

Public Member Functions

void traverse (SgNode *node, Order treeTraversalOrder)
 traverse the entire AST. Order defines preorder (preorder) or postorder (postorder) traversal. Default is 'preorder'.
void traverseWithinFile (SgNode *node, Order treeTraversalOrder)
 traverse only nodes which represent the same file as where the traversal was started
void traverseInputFiles (SgProject *projectNode, Order treeTraversalOrder)
 traverse only nodes which represent files which were specified on the command line (=input files).

Protected Member Functions

virtual void visit (SgNode *astNode)=0
 this method is called at every traversed node.
virtual void atTraversalStart ()
 GB (06/04/2007): A new virtual function called at the start of the traversal, before any node is actually visited; can be used to perform a "last-minute" computation of attributes that may have changed since the constructor was executed, but are constant during the traversal itself.
virtual void atTraversalEnd ()

Private Member Functions

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

Friends

class AstCombinedSimpleProcessing


Member Typedef Documentation

typedef t_traverseOrder AstSimpleProcessing::Order


Member Function Documentation

AstSimpleProcessing::traverse ( SgNode node,
Order  treeTraversalOrder 
)

traverse the entire AST. Order defines preorder (preorder) or postorder (postorder) traversal. Default is 'preorder'.

This is the call to start the traversal on the subtree defined by node.

Parameters:
node represents the root of the subtree in the AST
treeTraversalOrder represents the traversal order (preorder or postorder).

void AstSimpleProcessing::traverseWithinFile ( SgNode node,
Order  treeTraversalOrder 
)

traverse only nodes which represent the same file as where the traversal was started

AstSimpleProcessing::traverseInputFiles ( SgProject projectNode,
Order  treeTraversalOrder 
)

traverse only nodes which represent files which were specified on the command line (=input files).

This is the call to start the traversal on the subtree defined by root. This function will cause AST nodes that have a source position in any other files to be skipped (skips all header files for example).

Parameters:
projectNode represents the root of the subtree in the AST
treeTraversalOrder represents the traversal order (preorder or postorder).

virtual void AstSimpleProcessing::visit ( SgNode astNode  )  [protected, pure virtual]

this method is called at every traversed node.

Implemented in SageInterface::OutputLocalSymbolTables, RoseBin_CompareAnalysis, RoseBin_FlowAnalysis, RoseBin_printInstructions, LibraryIdentification::FlattenAST, OmpSupport::translationDriver, AstCombinedSimpleProcessing, AstNodeVisitMapping, AstSharedMemoryParallelizableSimpleProcessing, and AstTextAttributesHandling.

virtual void AstSimpleProcessing::atTraversalStart (  )  [protected, virtual]

GB (06/04/2007): A new virtual function called at the start of the traversal, before any node is actually visited; can be used to perform a "last-minute" computation of attributes that may have changed since the constructor was executed, but are constant during the traversal itself.

A no-op by default.

Reimplemented from SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.

Reimplemented in AstCombinedSimpleProcessing.

virtual void AstSimpleProcessing::atTraversalEnd (  )  [protected, virtual]

Reimplemented from SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.

Reimplemented in AstCombinedSimpleProcessing, and AstSharedMemoryParallelizableSimpleProcessing.

DummyAttribute AstSimpleProcessing::evaluateInheritedAttribute ( SgNode astNode,
DummyAttribute  inheritedValue 
) [private]

DummyAttribute AstSimpleProcessing::evaluateSynthesizedAttribute ( SgNode astNode,
DummyAttribute  inheritedValue,
SynthesizedAttributesList  l 
) [private]

DummyAttribute AstSimpleProcessing::defaultSynthesizedAttribute ( DummyAttribute  inheritedValue  )  [private]


Friends And Related Function Documentation

friend class AstCombinedSimpleProcessing [friend]


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