ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AstSimpleProcessing.h
Go to the documentation of this file.
1 // Original Author (AstProcessing classes): Markus Schordan
2 // Rewritten by: Gergo Barany
3 // $Id: AstSimpleProcessing.h,v 1.3 2008/01/08 02:56:39 dquinlan Exp $
4 
5 // See comments in AstProcessing.h for list of changes during the rewrite
6 
7 #ifndef ASTPROCESSINGSIMPLE_H
8 #define ASTPROCESSINGSIMPLE_H
9 
10 #include "AstProcessing.h"
11 
12 // GB (7/6/2007): Added AstPrePostProcessing as a pre- and postorder
13 // traversal without attributes -- I feel this will be useful for many
14 // applications. (At least, I constantly find myself wanting to write
15 // traversals that simply push nodes onto a stack in the preorder visit and
16 // pop the stack in the postorder visit. With the existing traversal classes I
17 // had to use a TopDownBottomUpProcessing and ignore the attributes.)
19 
21  : public SgTreeTraversal<DummyAttribute, DummyAttribute>
22 {
23 public:
25  void traverse(SgNode *node);
26 
28  void traverseWithinFile(SgNode *node);
29 
31  void traverseInputFiles(SgProject *projectNode);
32 
34 
35 protected:
37  virtual void preOrderVisit(SgNode *astNode) = 0;
38 
40  virtual void postOrderVisit(SgNode *astNode) = 0;
41 
43  virtual void atTraversalStart();
44  virtual void atTraversalEnd();
45 
46 private:
51 };
52 
53 
54 // Logically, AstSimpleProcessing could be derived from
55 // AstPrePostProcessing, but that results in a (barely) measurable
56 // performance hit.
58 
60  : public SgTreeTraversal<DummyAttribute, DummyAttribute>
61 {
62 public:
64 
66  void traverse(SgNode* node, Order treeTraversalOrder);
67 
69  void traverseWithinFile(SgNode* node, Order treeTraversalOrder);
70 
72  void traverseInputFiles(SgProject* projectNode, Order treeTraversalOrder);
73 
75 
76 protected:
78  virtual void visit(SgNode* astNode) = 0;
79 
85  virtual void atTraversalStart();
86  virtual void atTraversalEnd();
87 
88 private:
93 };
94 
95 
98 
99 #endif