ROSE 0.11.145.147
Public Types | Public Member Functions | Protected Member Functions | List of all members
AstSimpleProcessing Class Referenceabstract

Description

Class for traversing the AST.

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.

Definition at line 59 of file AstSimpleProcessing.h.

#include <AstProcessing.h>

Inheritance diagram for AstSimpleProcessing:
Inheritance graph
[legend]
Collaboration diagram for AstSimpleProcessing:
Collaboration graph
[legend]

Public Types

typedef t_traverseOrder Order
 
- Public Types inherited from SgTreeTraversal< DummyAttribute, DummyAttribute >
typedef StackFrameVector< DummyAttribute > SynthesizedAttributesList
 

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

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 ()
 
- Protected Member Functions inherited from SgTreeTraversal< DummyAttribute, DummyAttribute >
virtual void setNodeSuccessors (SgNode *node, SuccessorsContainer &succContainer)
 
void set_useDefaultIndexBasedTraversal (bool)
 

Additional Inherited Members

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

Member Typedef Documentation

◆ Order

typedef t_traverseOrder AstSimpleProcessing::Order

Definition at line 63 of file AstSimpleProcessing.h.

Member Function Documentation

◆ traverse()

AstSimpleProcessing::traverse ( SgNode node,
Order  treeTraversalOrder 
)

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

Function to start the traversal on the subtree defined by node.

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

Parameters
noderepresents the root of the subtree in the AST
treeTraversalOrderrepresents the traversal order (preorder or postorder).

◆ traverseInputFiles()

AstSimpleProcessing::traverseInputFiles ( SgProject projectNode,
Order  treeTraversalOrder 
)

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

Function to start the traversal on the subtree defined by root (skip and nodes from other 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
projectNoderepresents the root of the subtree in the AST
treeTraversalOrderrepresents the traversal order (preorder or postorder).

◆ visit()

virtual void AstSimpleProcessing::visit ( SgNode astNode)
protectedpure virtual

◆ atTraversalStart()

virtual void AstSimpleProcessing::atTraversalStart ( )
protectedvirtual

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

Reimplemented in AstCombinedSimpleProcessing.

◆ atTraversalEnd()

virtual void AstSimpleProcessing::atTraversalEnd ( )
protectedvirtual

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