ROSE  0.9.9.139
AstCombinedSimpleProcessing.h
1 // Author: Gergo Barany
2 // $Id: AstCombinedSimpleProcessing.h,v 1.1 2008/01/08 02:56:38 dquinlan Exp $
3 
4 // Class for combining AstSimpleProcessing traversals; see the comment in
5 // AstCombinedProcessing.h for general information.
6 
7 #ifndef ASTCOMBINEDSIMPLEPROCESSING_H
8 #define ASTCOMBINEDSIMPLEPROCESSING_H
9 
10 #include "AstSimpleProcessing.h"
11 
12 class ROSE_DLL_API AstCombinedSimpleProcessing
13  : public AstSimpleProcessing
14 {
15 public:
17  typedef TraversalType *TraversalPtr;
18  typedef std::vector<TraversalPtr> TraversalPtrList;
19 
23  AstCombinedSimpleProcessing(const TraversalPtrList &);
24 
26  void addTraversal(TraversalPtr);
30  TraversalPtrList &get_traversalPtrListRef();
31 
32 protected:
34  virtual void visit(SgNode* astNode);
35 
36  virtual void atTraversalStart();
37  virtual void atTraversalEnd();
38 
39  TraversalPtrList traversals;
40 
41 private:
42  TraversalPtrList::iterator tBegin, tEnd;
43  TraversalPtrList::size_type numberOfTraversals;
44 };
45 
47  : public AstPrePostProcessing
48 {
49 public:
51  typedef TraversalType *TraversalPtr;
52  typedef std::vector<TraversalPtr> TraversalPtrList;
53 
57  AstCombinedPrePostProcessing(const TraversalPtrList &);
58 
60  void addTraversal(TraversalPtr);
64  TraversalPtrList &get_traversalPtrListRef();
65 
66 protected:
68  virtual void preOrderVisit(SgNode* astNode);
69  virtual void postOrderVisit(SgNode* astNode);
70 
71  virtual void atTraversalStart();
72  virtual void atTraversalEnd();
73 
74  TraversalPtrList traversals;
75 
76 private:
77  TraversalPtrList::iterator tBegin, tEnd;
78  TraversalPtrList::size_type numberOfTraversals;
79 };
80 
81 #endif
virtual void postOrderVisit(SgNode *astNode)
this method is called at every traversed node after its children were traversed
Class for traversing the AST.
TraversalPtrList & get_traversalPtrListRef()
function for obtaining a reference to the internal list of traversals, you can use this for any conta...
virtual void atTraversalStart()
GB (06/04/2007): A new virtual function called at the start of the traversal, before any node is actu...
virtual void preOrderVisit(SgNode *astNode)
these methods are called at every traversed node.
virtual void atTraversalStart()
functions called when the traversal starts and ends, respectively
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.
Definition: Cxx_Grammar.h:8322
AstCombinedPrePostProcessing()
default constructor
virtual void visit(SgNode *astNode)=0
this method is called at every traversed node.