00001 // Author: Gergo Barany 00002 // $Id: AstCombinedSimpleProcessing.h,v 1.1 2008/01/08 02:56:38 dquinlan Exp $ 00003 00004 // Class for combining AstSimpleProcessing traversals; see the comment in 00005 // AstCombinedProcessing.h for general information. 00006 00007 #ifndef ASTCOMBINEDSIMPLEPROCESSING_H 00008 #define ASTCOMBINEDSIMPLEPROCESSING_H 00009 00010 #include "AstSimpleProcessing.h" 00011 00012 class AstCombinedSimpleProcessing 00013 : public AstSimpleProcessing 00014 { 00015 public: 00016 typedef AstSimpleProcessing TraversalType; 00017 typedef TraversalType *TraversalPtr; 00018 typedef std::vector<TraversalPtr> TraversalPtrList; 00019 00021 AstCombinedSimpleProcessing(); 00023 AstCombinedSimpleProcessing(const TraversalPtrList &); 00024 00026 void addTraversal(TraversalPtr); 00030 TraversalPtrList &get_traversalPtrListRef(); 00031 00032 protected: 00034 virtual void visit(SgNode* astNode); 00035 00036 virtual void atTraversalStart(); 00037 virtual void atTraversalEnd(); 00038 00039 TraversalPtrList traversals; 00040 00041 private: 00042 TraversalPtrList::iterator tBegin, tEnd; 00043 TraversalPtrList::size_type numberOfTraversals; 00044 }; 00045 00046 class AstCombinedPrePostProcessing 00047 : public AstPrePostProcessing 00048 { 00049 public: 00050 typedef AstPrePostProcessing TraversalType; 00051 typedef TraversalType *TraversalPtr; 00052 typedef std::vector<TraversalPtr> TraversalPtrList; 00053 00055 AstCombinedPrePostProcessing(); 00057 AstCombinedPrePostProcessing(const TraversalPtrList &); 00058 00060 void addTraversal(TraversalPtr); 00064 TraversalPtrList &get_traversalPtrListRef(); 00065 00066 protected: 00068 virtual void preOrderVisit(SgNode* astNode); 00069 virtual void postOrderVisit(SgNode* astNode); 00070 00071 virtual void atTraversalStart(); 00072 virtual void atTraversalEnd(); 00073 00074 TraversalPtrList traversals; 00075 00076 private: 00077 TraversalPtrList::iterator tBegin, tEnd; 00078 TraversalPtrList::size_type numberOfTraversals; 00079 }; 00080 00081 #endif
1.4.7