ROSE 0.11.145.147
|
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>
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 SgTreeTraversal & | operator= (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 |
typedef SgTreeTraversal<InheritedAttributeType,DummyAttribute>::SynthesizedAttributesList AstTopDownProcessing< InheritedAttributeType >::SynthesizedAttributesList |
Definition at line 242 of file AstProcessing.h.
void AstTopDownProcessing< InheritedAttributeType >::traverse | ( | SgNode * | node, |
InheritedAttributeType | inheritedValue | ||
) |
evaluates attributes on the entire AST
Definition at line 539 of file AstProcessing.h.
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.
|
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 >.
|
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.
|
protectedvirtual |
Reimplemented from SgTreeTraversal< InheritedAttributeType, DummyAttribute >.
Definition at line 951 of file AstProcessing.h.
|
protectedvirtual |
Definition at line 937 of file AstProcessing.h.