16#ifndef ASTCOMBINEDPROCESSING_H
17#define ASTCOMBINEDPROCESSING_H
19#include "AstProcessing.h"
21template <
class InheritedAttributeType,
class SynthesizedAttributeType>
23 :
public SgTreeTraversal< std::vector<InheritedAttributeType> *, std::vector<SynthesizedAttributeType> *>
28 typedef std::vector<TraversalPtr> TraversalPtrList;
29 typedef std::vector<InheritedAttributeType> InheritedAttributeTypeList;
30 typedef std::vector<SynthesizedAttributeType> SynthesizedAttributeTypeList;
47 virtual InheritedAttributeTypeList *evaluateInheritedAttribute(
49 InheritedAttributeTypeList *inheritedValues);
50 virtual SynthesizedAttributeTypeList *evaluateSynthesizedAttribute(
52 InheritedAttributeTypeList *inheritedValues,
54 virtual SynthesizedAttributeTypeList *defaultSynthesizedAttribute(InheritedAttributeTypeList *);
55 virtual void atTraversalStart();
56 virtual void atTraversalEnd();
58 TraversalPtrList traversals;
61 typename TraversalPtrList::iterator tBegin, tEnd;
62 typename TraversalPtrList::size_type numberOfTraversals;
65template <
class InheritedAttributeType,
class SynthesizedAttributeType>
72 typedef std::vector<TraversalPtr> TraversalPtrList;
73 typedef std::vector<InheritedAttributeType> InheritedAttributeTypeList;
74 typedef std::vector<SynthesizedAttributeType> SynthesizedAttributeTypeList;
76 typedef typename Superclass::SynthesizedAttributesList SynthesizedAttributesList;
93 InheritedAttributeTypeList *inheritedValues);
96 InheritedAttributeTypeList *inheritedValues,
97 SynthesizedAttributesList synthesizedAttributes);
98 virtual SynthesizedAttributeTypeList *defaultSynthesizedAttribute(InheritedAttributeTypeList *);
100 virtual void atTraversalEnd();
102 TraversalPtrList traversals;
105 typename TraversalPtrList::iterator tBegin, tEnd;
106 typename TraversalPtrList::size_type numberOfTraversals;
109template <
class InheritedAttributeType>
116 typedef std::vector<TraversalPtr> TraversalPtrList;
117 typedef std::vector<InheritedAttributeType> InheritedAttributeTypeList;
134 InheritedAttributeTypeList *inheritedValues);
136 virtual void atTraversalEnd();
137 virtual void destroyInheritedValue(
SgNode*, InheritedAttributeTypeList *);
139 TraversalPtrList traversals;
142 typename TraversalPtrList::iterator tBegin, tEnd;
143 typename TraversalPtrList::size_type numberOfTraversals;
146template <
class SynthesizedAttributeType>
153 typedef std::vector<TraversalPtr> TraversalPtrList;
154 typedef std::vector<SynthesizedAttributeType> SynthesizedAttributeTypeList;
156 typedef typename Superclass::SynthesizedAttributesList SynthesizedAttributesList;
171 virtual SynthesizedAttributeTypeList *evaluateSynthesizedAttribute(
173 SynthesizedAttributesList synthesizedAttributes);
176 virtual void atTraversalEnd();
178 TraversalPtrList traversals;
181 typename TraversalPtrList::iterator tBegin, tEnd;
182 typename TraversalPtrList::size_type numberOfTraversals;
185#include "AstCombinedProcessingImpl.h"
187#include "AstCombinedSimpleProcessing.h"
Attribute Evaluator for synthesized attributes.
void addTraversal(TraversalPtr)
simple function for adding a traversal to the internal list
virtual SynthesizedAttributeTypeList * defaultSynthesizedAttribute()
Allows to provide a default value for a synthesized attribute of primitive type (e....
AstCombinedBottomUpProcessing(const TraversalPtrList &)
constructor that makes an internal copy of an existing list of traversals
virtual void atTraversalStart()
Function called at the start of the traversal, before any node is visited; override if necessary,...
AstCombinedBottomUpProcessing()
default constructor
TraversalPtrList & get_traversalPtrListRef()
function for obtaining a reference to the internal list of traversals, you can use this for any conta...
TraversalPtrList & get_traversalPtrListRef()
function for obtaining a reference to the internal list of traversals, you can use this for any conta...
virtual InheritedAttributeTypeList * evaluateInheritedAttribute(SgNode *astNode, InheritedAttributeTypeList *inheritedValues)
pure virtual function which must be implemented to compute the inherited attribute at a node
AstCombinedTopDownBottomUpProcessing(const TraversalPtrList &)
constructor that makes an internal copy of an existing list of traversals
void addTraversal(TraversalPtr)
simple function for adding a traversal to the internal list
virtual void atTraversalStart()
Function called at the start of the traversal, before any node is visited; override if necessary,...
virtual SynthesizedAttributeTypeList * evaluateSynthesizedAttribute(SgNode *astNode, InheritedAttributeTypeList *inheritedValues, SynthesizedAttributesList synthesizedAttributes)
pure virtual function which must be implemented to compute the synthesized attribute at a node.
AstCombinedTopDownBottomUpProcessing()
default constructor
virtual InheritedAttributeTypeList * evaluateInheritedAttribute(SgNode *astNode, InheritedAttributeTypeList *inheritedValues)
pure virtual function which must be implemented to compute the inherited attribute at a node
virtual void atTraversalStart()
Function called at the start of the traversal, before any node is visited; override if necessary,...
TraversalPtrList & get_traversalPtrListRef()
function for obtaining a reference to the internal list of traversals, zou can use this for any conta...
AstCombinedTopDownProcessing()
default constructor
void addTraversal(TraversalPtr)
simple function for adding a traversal to the internal list
AstCombinedTopDownProcessing(const TraversalPtrList &)
constructor that makes an internal copy of an existing list of traversals
Attribute Evaluator for inherited and synthesized attributes.
Attribute Evaluator for inherited attributes.
TraversalPtrList & get_traversalPtrListRef()
function for obtaining a reference to the internal list of traversals, you can use this for any conta...
SgCombinedTreeTraversal()
default constructor
SgCombinedTreeTraversal(const TraversalPtrList &)
constructor that makes an internal copy of an existing list of traversals
void addTraversal(TraversalPtr)
simple function for adding a traversal to the internal list
This class represents the base class for all IR nodes within Sage III.
This class is temporary. Do not use.