ROSE
0.9.6a
|
Attribute Evaluator for synthesized attributes. More...
#include <AstProcessing.h>
Public Member Functions | |
SynthesizedAttributeType | traverse (SgNode *node) |
evaluates attributes on the entire AST More... | |
SynthesizedAttributeType | traverseWithinFile (SgNode *node) |
evaluates attributes only at nodes which represent the same file as where the evaluation was started More... | |
void | traverseInputFiles (SgProject *projectNode) |
evaluates attributes only at nodes which represent files which were specified on the command line (=input files). More... | |
![]() | |
SynthesizedAttributeType | traverse (SgNode *basenode, DummyAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder) |
SynthesizedAttributeType | traverseWithinFile (SgNode *basenode, DummyAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder) |
void | traverseInputFiles (SgProject *projectNode, DummyAttributeinheritedValue, t_traverseOrder travOrder=preandpostorder) |
virtual | ~SgTreeTraversal () |
SgTreeTraversal () | |
SgTreeTraversal (const SgTreeTraversal &) | |
const SgTreeTraversal & | operator= (const SgTreeTraversal &) |
Protected Member Functions | |
virtual SynthesizedAttributeType | evaluateSynthesizedAttribute (SgNode *, SynthesizedAttributesList)=0 |
pure virtual function which must be implemented to compute the synthesized attribute at a node. More... | |
virtual SynthesizedAttributeType | defaultSynthesizedAttribute () |
Allows to provide a default value for a synthesized attribute of primitive type (e.g. More... | |
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. More... | |
virtual void | atTraversalEnd () |
![]() | |
virtual SynthesizedAttributeType | evaluateSynthesizedAttribute (SgNode *n, DummyAttributein, SynthesizedAttributesList l)=0 |
virtual void | setNodeSuccessors (SgNode *node, SuccessorsContainer &succContainer) |
void | set_useDefaultIndexBasedTraversal (bool) |
Private Member Functions | |
virtual DummyAttribute | evaluateInheritedAttribute (SgNode *astNode, DummyAttribute inheritedValue) |
virtual SynthesizedAttributeType | evaluateSynthesizedAttribute (SgNode *astNode, DummyAttribute inheritedValue, SynthesizedAttributesList l) |
virtual SynthesizedAttributeType | defaultSynthesizedAttribute (DummyAttribute inheritedValue) |
Friends | |
class | AstCombinedBottomUpProcessing< SynthesizedAttributeType > |
class | DistributedMemoryAnalysisPostTraversal< SynthesizedAttributeType > |
Additional Inherited Members | |
![]() | |
typedef AstSuccessorsSelectors::SuccessorsContainer | SuccessorsContainer |
typedef SuccessorsContainer & | SuccessorsContainerRef |
Attribute Evaluator for synthesized attributes.
This class allows to compute synthesized attributes on the AST. It requires a synthesized attribute type as a template parameter and the implementation of the function evaluateSynthesizedAttribute. This function is invoked in post-order while the AST is traversed. It can be used for passing information up the AST and for computing a synthesized attribute at each node based on the results of its children in the AST.
Initialization of synthesized attributes is necessary for values which represent results of non-existent nodes (= null pointers in the AST) or skipped nodes (e.g. traverseWithingFile skips all nodes which do not represent the same file as from where the evaluation of attributes started).
This class is derived from the SgTreeTraversal class.
Definition at line 289 of file AstProcessing.h.
typedef SgTreeTraversal<DummyAttribute, SynthesizedAttributeType>::SynthesizedAttributesList AstBottomUpProcessing< SynthesizedAttributeType >::SynthesizedAttributesList |
Definition at line 294 of file AstProcessing.h.
typedef SynthesizedAttributesList AstBottomUpProcessing< SynthesizedAttributeType >::SubTreeSynthesizedAttributes |
Definition at line 297 of file AstProcessing.h.
SynthesizedAttributeType AstBottomUpProcessing< SynthesizedAttributeType >::traverse | ( | SgNode * | node) |
evaluates attributes on the entire AST
Definition at line 612 of file AstProcessing.h.
Referenced by parallelBottomUpProcessingThread().
SynthesizedAttributeType AstBottomUpProcessing< SynthesizedAttributeType >::traverseWithinFile | ( | SgNode * | node) |
evaluates attributes only at nodes which represent the same file as where the evaluation was started
Definition at line 624 of file AstProcessing.h.
void AstBottomUpProcessing< SynthesizedAttributeType >::traverseInputFiles | ( | SgProject * | projectNode) |
evaluates attributes only at nodes which represent files which were specified on the command line (=input files).
Definition at line 635 of file AstProcessing.h.
|
protectedpure virtual |
pure virtual function which must be implemented to compute the synthesized attribute at a node.
The list of synthesized attributes consists of the synthesized attributes computed at the children node of the current node. The inherited attribute value is computed by the function evaluateInheritedAttribute at the same node and simply passed to this function. Use the typedef SynthesizedAttributeList as type for the synthesized attributes list.
Implemented in VariableRenaming::DefsAndUsesTraversal, VariableRenaming::UniqueNameTraversal, AstSharedMemoryParallelizableBottomUpProcessing< S >, ssa_private::UniqueNameTraversal, AstCombinedBottomUpProcessing< S >, ssa_unfiltered_cfg::DefsAndUsesTraversal, ssa_private::DefsAndUsesTraversal, BottomUpTraversalLivenessOUT, FunctionNamesPostTraversal, AstNodePtrs, and BottomUpTraversalLivenessIN.
|
protectedvirtual |
Allows to provide a default value for a synthesized attribute of primitive type (e.g.
int, bool, etc.). If a class is used as type for a synthesized attribute the default constructor of this class is sufficient and this function does not have be implemented.
Reimplemented in AstCombinedBottomUpProcessing< SynthesizedAttributeType >, AstCombinedBottomUpProcessing< S >, BottomUpTraversalLivenessOUT, FunctionNamesPostTraversal, and BottomUpTraversalLivenessIN.
Definition at line 578 of file AstProcessing.h.
|
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< DummyAttribute, SynthesizedAttributeType >.
Reimplemented in AstCombinedBottomUpProcessing< SynthesizedAttributeType >, and AstCombinedBottomUpProcessing< S >.
Definition at line 939 of file AstProcessing.h.
|
protectedvirtual |
Reimplemented from SgTreeTraversal< DummyAttribute, SynthesizedAttributeType >.
Reimplemented in AstSharedMemoryParallelizableBottomUpProcessing< SynthesizedAttributeType >, AstSharedMemoryParallelizableBottomUpProcessing< S >, AstCombinedBottomUpProcessing< SynthesizedAttributeType >, and AstCombinedBottomUpProcessing< S >.
Definition at line 946 of file AstProcessing.h.
|
privatevirtual |
Implements SgTreeTraversal< DummyAttribute, SynthesizedAttributeType >.
Definition at line 565 of file AstProcessing.h.
|
privatevirtual |
Definition at line 598 of file AstProcessing.h.
|
privatevirtual |
Reimplemented from SgTreeTraversal< DummyAttribute, SynthesizedAttributeType >.
Definition at line 590 of file AstProcessing.h.
|
friend |
Definition at line 312 of file AstProcessing.h.
|
friend |
Definition at line 313 of file AstProcessing.h.