AstSimpleProcessing
Class for traversing the AST.
Synopsis
Declared in <src/midend/astProcessing/AstSimpleProcessing.h>
Base Classes
Name |
Description |
Temporary traversal base class (do not use). |
Types
Name |
Member Functions
Name |
Description |
traverse the entire AST. Order defines preorder (preorder) or postorder (postorder) traversal. Default is 'preorder'. |
|
traverse only nodes which represent files which were specified on the command line (=input files). |
|
traverse only nodes which represent the same file as where the traversal was started |
Protected Member Functions
Name |
Description |
|
|
|
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. |
|
this method is called at every traversed node. |
Private Member Functions
Name |
|
|
|
Friends
Name |
Description |
Derived Classes
Name |
Description |
/////////////////////////////////////////////////////////////////////////////////////// |
|
/////////////////////////////////////////////////////////////////////////////////////// |
|
Fixup pointers in the AST that user's may have left as NULL, but should not be NULL. |
|
Fixup known macros that reference themselves and cause recursive macro expansion in the generated (unparsed) code. |
|
A driver to traverse AST trees and invoke individual translators for OpenMP constructs, (not in use) Postorder is preferred. |
Description
‐ 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. ‐ Internal: This class is derived from the SgTreeTraversal class.
Member functions
#### AstSimpleProcessing::traverse(SgNode* node, Order treeTraversalOrder) 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. ‐ Param node: represents the root of the subtree in the AST ‐ Param treeTraversalOrder: represents the traversal order (preorder or postorder).
#### AstSimpleProcessing::traverseInputFiles(SgProject* projectNode, Order treeTraversalOrder) 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). ‐ Param projectNode: represents the root of the subtree in the AST ‐ Param treeTraversalOrder: represents the traversal order (preorder or postorder).
Created with MrDocs