ROSE 0.11.145.147
sageTraversal.h
1#ifndef ROSE_sageTraversal_H
2#define ROSE_sageTraversal_H
3
4#include <rosedll.h>
5
6// DQ (11/26/2005): Support for visitor pattern.
9class SgNode;
10
11// DQ (12/23/2005): support for traversal of AST using visitor pattern
12ROSE_DLL_API void traverseMemoryPoolNodes ( ROSE_VisitTraversal & traversal );
13ROSE_DLL_API void traverseMemoryPoolVisitorPattern ( ROSE_VisitorPattern & visitor );
14
15// DQ (2/9/2006): Added to support traversal over single representative of each IR node
16// This traversal helps support intrnal tools that call static member functions.
17ROSE_DLL_API void traverseRepresentativeNodes ( ROSE_VisitTraversal & traversal );
18
19// DQ (12/26/2005): Simple traversal base class for use with ROSE style
20// traversals. Need to move this to a different location later.
22 {
23 public:
24 virtual ~ROSE_VisitTraversal() {};
25 virtual void visit (SgNode* node) = 0;
26 void traverseMemoryPool()
27 {
28 traverseMemoryPoolNodes(*this);
29 }
30 void traverseRepresentativeIRnodes()
31 {
32 traverseRepresentativeNodes(*this);
33 }
34 };
35#endif
This class represents the base class for all IR nodes within Sage III.
static void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
static void traverseMemoryPoolNodes(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.