AstTopDownBottomUpProcessing
Attribute evaluator for inherited and synthesized attributes.
Synopsis
Declared in <src/midend/astProcessing/AstProcessing.h>
template<
class InheritedAttributeType,
class SynthesizedAttributeType>
class AstTopDownBottomUpProcessing
: public SgTreeTraversal<InheritedAttributeType, SynthesizedAttributeType>
Base Classes
Name |
Description |
|
Temporary traversal base class (do not use). |
Member Functions
Name |
Description |
evaluates attributes on the entire AST |
|
evaluates attributes only at nodes which represent the same file as where the evaluation was started |
Protected Member Functions
Name |
Description |
|
|
|
Function called at the start of the traversal, before any node is visited; override if necessary, the default implementation is a no‐op. |
|
pure virtual function which must be implemented to compute the inherited attribute at a node |
|
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. |
Friends
Name |
Description |
Derived Classes
Name |
Description |
/////////////////////////////////////////////////////////////////////////////////////// |
|
Traverses a given AST and finds all function calls in the order in which they're evaluated Also, for each function we find where to put declarations of temporary variables so that they're accessible at the function call |
|
Description
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 computation of inherited and synthesized attributes on the AST. It requires an inherited attribute type and a synthesized attribute type as template parameters and the implementation of the functions 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 an 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.
Internal: This class is derived from the SgTreeTraversal class.
Created with MrDocs