#include <AstProcessing.h>
Inheritance diagram for AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >:


In general, this class combines the classes TopDownProcessing and BottomUpProcessing and also allows to use the inherited attribute of a node in the computation of the synthesized attribute at the same node.
This class allows to compute inherited and synthesized attributes on the AST. It requires an inherited attribute type and a synthesized attribute type as a template parameter and the implementation of the function evaluateInheritedAttribute and evaluateSynthesizedAttribute. The function evaluateInheritedAttribute is invoked in pre-order, the function evaluateSynthesizedAttribute is invoked in post-order while the AST is traversed. The function evaluateSynthesizedAttribute gets as additional parameter the inheritedAttribute value which is computed at the respective node. It can be used to make the computation of the synthesized attribute at a node dependent on the value of the inherited attribute of the same node.
For internal use only.
This class is derived from the SgTreeTraversal class.
Public Types | |
| typedef SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >::SynthesizedAttributesList | SynthesizedAttributesList |
| typedef SynthesizedAttributesList | SubTreeSynthesizedAttributes |
Public Member Functions | |
| SynthesizedAttributeType | traverse (SgNode *node, InheritedAttributeType inheritedValue) |
| evaluates attributes on the entire AST | |
| SynthesizedAttributeType | traverseWithinFile (SgNode *node, InheritedAttributeType inheritedValue) |
| evaluates attributes only at nodes which represent the same file as where the evaluation was started | |
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 SynthesizedAttributeType | evaluateSynthesizedAttribute (SgNode *, InheritedAttributeType, SynthesizedAttributesList)=0 |
| pure virtual function which must be implemented to compute the synthesized 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 () |
Friends | |
| class | AstCombinedTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType > |
| typedef SgTreeTraversal<InheritedAttributeType, SynthesizedAttributeType>::SynthesizedAttributesList AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >::SynthesizedAttributesList |
Reimplemented from SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.
Reimplemented in AstCombinedTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >, AstSharedMemoryParallelizableTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >, AstCombinedTopDownBottomUpProcessing< I, S >, and AstSharedMemoryParallelizableTopDownBottomUpProcessing< I, S >.
| typedef SynthesizedAttributesList AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >::SubTreeSynthesizedAttributes |
| SynthesizedAttributeType AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >::traverse | ( | SgNode * | node, | |
| InheritedAttributeType | inheritedValue | |||
| ) |
evaluates attributes on the entire AST
| SynthesizedAttributeType AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >::traverseWithinFile | ( | SgNode * | node, | |
| InheritedAttributeType | inheritedValue | |||
| ) |
evaluates attributes only at nodes which represent the same file as where the evaluation was started
| virtual InheritedAttributeType AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >::evaluateInheritedAttribute | ( | SgNode * | astNode, | |
| InheritedAttributeType | inheritedValue | |||
| ) | [protected, pure virtual] |
pure virtual function which must be implemented to compute the inherited attribute at a node
Implements SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.
Implemented in AttachAllPreprocessingInfoTreeTrav, AttachPreprocessingInfoTreeTrav, FunctionEvaluationOrderTraversal, AstCombinedTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >, and AstCombinedTopDownBottomUpProcessing< I, S >.
| virtual SynthesizedAttributeType AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >::evaluateSynthesizedAttribute | ( | SgNode * | , | |
| InheritedAttributeType | , | |||
| SynthesizedAttributesList | ||||
| ) | [protected, pure 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 evaluateInheritedAttribute at the same node and simply passed to this function. Use the typedef SynthesizedAttributeList as type for the synthesized attributes list.
| void AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >::atTraversalStart | ( | ) | [protected, virtual] |
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, SynthesizedAttributeType >.
Reimplemented in AstCombinedTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >, and AstCombinedTopDownBottomUpProcessing< I, S >.
| void AstTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >::atTraversalEnd | ( | ) | [protected, virtual] |
Reimplemented from SgTreeTraversal< InheritedAttributeType, SynthesizedAttributeType >.
Reimplemented in AstCombinedTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >, AstSharedMemoryParallelizableTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType >, AstCombinedTopDownBottomUpProcessing< I, S >, and AstSharedMemoryParallelizableTopDownBottomUpProcessing< I, S >.
friend class AstCombinedTopDownBottomUpProcessing< InheritedAttributeType, SynthesizedAttributeType > [friend] |
1.4.7