Skip to content

AstSimpleProcessing

Class for traversing the AST.

Synopsis

Declared in <src/midend/astProcessing/AstSimpleProcessing.h>

Base Classes

Name

Description

SgTreeTraversal<DummyAttribute, DummyAttribute>

Temporary traversal base class (do not use).

Types

Name

Order

Member Functions

Name

Description

traverse

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

traverseInputFiles

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

traverseWithinFile

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

Protected Member Functions

Name

Description

atTraversalEnd [virtual]

atTraversalStart [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.

visit [virtual]

this method is called at every traversed node.

Private Member Functions

Friends

Name

Description

AstCombinedSimpleProcessing

Derived Classes

Name

Description

AstCombinedSimpleProcessing

AstReverseBranchSimpleProcessing

///////////////////////////////////////////////////////////////////////////////////////

AstReversePrefixSimpleProcessing

///////////////////////////////////////////////////////////////////////////////////////

BuildListOfConnectedNodesInAST

Counter

DummyTestQuery1

FixupAstSymbolTables

FixupAstSymbolTablesToSupportAliasedSymbols

FixupFortranReferences

FixupFortranUseDeclarations

FixupFunctionDefinitions

FixupNullPointersInAST

Fixup pointers in the AST that user's may have left as NULL, but should not be NULL.

FixupSelfReferentialMacrosInAST

Fixup known macros that reference themselves and cause recursive macro expansion in the generated (unparsed) code.

FixupTemplateDeclarations

Graph_TokenMappingTraversal

IncludedFilesUnparser

IncludingPreprocessingInfosCollector

InsertFortranContainsStatement

OutputEdges

OutputLocalSymbolTables

OutputNodes

ProcessTemplateHandlingOptions

SgSimpleProcessing

SgVarRefExpVisitor

SingleStatementToBlockNormalizer

SlicingInfo

TestAstAccessToDeclarations

TestAstCompilerGeneratedNodes

TestAstForProperlyMangledNames

TestAstForProperlySetDefiningAndNondefiningDeclarations

TestAstForUniqueNodesInAST

TestAstForUniqueStatementsInScopes

TestAstSymbolTables

TestAstTemplateProperties

TestExpressionTypes

TestForMultipleWaysToSpecifyRestrictKeyword

TestForSourcePosition

TestLValueExpressions

TestLValues

TraversalClass

translationDriver

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