Skip to content

AstTopDownProcessing

Attribute evaluator for inherited attributes.

Synopsis

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

template<class InheritedAttributeType>
class AstTopDownProcessing
    : public SgTreeTraversal<InheritedAttributeType, DummyAttribute>

Base Classes

Name

Description

SgTreeTraversal<InheritedAttributeType, DummyAttribute>

Temporary traversal base class (do not use).

Member Functions

Name

Description

traverse

evaluates attributes on the entire AST

traverseWithinFile

evaluates attributes only at nodes which represent the same file as where the evaluation was started

Protected Member Functions

Name

Description

atTraversalEnd [virtual]

atTraversalStart [virtual]

Function called at the start of the traversal, before any node is visited; override if necessary, the default implementation is a no‐op.

destroyInheritedValue [virtual]

evaluateInheritedAttribute [virtual]

pure virtual function which must be implemented to compute the inherited attribute at a node

Private Member Functions

Name

Description

defaultSynthesizedAttribute

evaluateSynthesizedAttribute

////////////////////////////////////////// TOP DOWN PROCESSING IMPLEMENTATION /////////////////////////////////////////////

Description

This class allows computation of 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.

Internal: This class is derived from the SgTreeTraversal class.

Created with MrDocs