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>

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.

Base Classes

Name Description
SgTreeTraversal<InheritedAttributeType, DummyAttribute>

Type Aliases

Name
SynthesizedAttributesList

Member Functions

Name Description
traverse
void traverse( SgNode* node, InheritedAttributeType inheritedValue);
evaluates attributes on the entire AST
traverseWithinFile
void traverseWithinFile( SgNode* node, InheritedAttributeType inheritedValue);
evaluates attributes only at nodes which represent the same file as where the evaluation was started

Protected Member Functions

Name Description
atTraversalEnd
virtual void atTraversalEnd(); [virtual]
atTraversalStart
virtual void 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 void destroyInheritedValue( SgNode*, InheritedAttributeType); [virtual]
evaluateInheritedAttribute
virtual InheritedAttributeType evaluateInheritedAttribute( SgNode* astNode, InheritedAttributeType inheritedValue) = 0; [virtual]
pure virtual function which must be implemented to compute the inherited attribute at a node

Private Member Functions

Name Description
defaultSynthesizedAttribute
DummyAttribute defaultSynthesizedAttribute(InheritedAttributeType inh);
evaluateSynthesizedAttribute
DummyAttribute evaluateSynthesizedAttribute( SgNode* astNode, InheritedAttributeType inheritedValue, SynthesizedAttributesList l);
////////////////////////////////////////// TOP DOWN PROCESSING IMPLEMENTATION /////////////////////////////////////////////

Friends

Name Description
DistributedMemoryAnalysisPreTraversal
AstCombinedTopDownProcessing

Derived Classes

Name Description
AstCombinedTopDownProcessing
AstReverseBranchInhProcessing
AstReversePrefixInhProcessing
SgTopDownProcessing
TestForProperLanguageAndSymbolTableCaseSensitivity

Created with MrDocs