00001
00002
00003
00004
00005
00006
00007 #ifndef ASTPROCESSINGSIMPLE_H
00008 #define ASTPROCESSINGSIMPLE_H
00009
00010 #include "AstProcessing.h"
00011
00012
00013
00014
00015
00016
00017
00018 class AstCombinedPrePostProcessing;
00019
00020 class AstPrePostProcessing
00021 : public SgTreeTraversal<DummyAttribute, DummyAttribute>
00022 {
00023 public:
00025 void traverse(SgNode *node);
00026
00028 void traverseWithinFile(SgNode *node);
00029
00031 void traverseInputFiles(SgProject *projectNode);
00032
00033 friend class AstCombinedPrePostProcessing;
00034
00035 protected:
00037 virtual void preOrderVisit(SgNode *astNode) = 0;
00038
00040 virtual void postOrderVisit(SgNode *astNode) = 0;
00041
00043 virtual void atTraversalStart();
00044 virtual void atTraversalEnd();
00045
00046 private:
00047 DummyAttribute evaluateInheritedAttribute(SgNode *astNode, DummyAttribute inheritedValue);
00048 DummyAttribute evaluateSynthesizedAttribute(SgNode* astNode, DummyAttribute inheritedValue,
00049 SynthesizedAttributesList l);
00050 DummyAttribute defaultSynthesizedAttribute(DummyAttribute inheritedValue);
00051 };
00052
00053
00054
00055
00056
00057 class AstCombinedSimpleProcessing;
00058
00059 class AstSimpleProcessing
00060 : public SgTreeTraversal<DummyAttribute, DummyAttribute>
00061 {
00062 public:
00063 typedef t_traverseOrder Order;
00064
00066 void traverse(SgNode* node, Order treeTraversalOrder);
00067
00069 void traverseWithinFile(SgNode* node, Order treeTraversalOrder);
00070
00072 void traverseInputFiles(SgProject* projectNode, Order treeTraversalOrder);
00073
00074 friend class AstCombinedSimpleProcessing;
00075
00076 protected:
00078 virtual void visit(SgNode* astNode) = 0;
00079
00085 virtual void atTraversalStart();
00086 virtual void atTraversalEnd();
00087
00088 private:
00089 DummyAttribute evaluateInheritedAttribute(SgNode *astNode, DummyAttribute inheritedValue);
00090 DummyAttribute evaluateSynthesizedAttribute(SgNode* astNode, DummyAttribute inheritedValue,
00091 SynthesizedAttributesList l);
00092 DummyAttribute defaultSynthesizedAttribute(DummyAttribute inheritedValue);
00093 };
00094
00095
00097 class SgSimpleProcessing : public AstSimpleProcessing {};
00098
00099 #endif