ROSE
0.9.6a
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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.)
18
class
AstCombinedPrePostProcessing
;
19
20
class
ROSE_DLL_API
AstPrePostProcessing
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
33
friend
class
AstCombinedPrePostProcessing
;
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
:
47
DummyAttribute
evaluateInheritedAttribute
(
SgNode
*astNode,
DummyAttribute
inheritedValue);
48
DummyAttribute
evaluateSynthesizedAttribute
(
SgNode
* astNode,
DummyAttribute
inheritedValue,
49
SynthesizedAttributesList
l);
50
DummyAttribute
defaultSynthesizedAttribute
(
DummyAttribute
inheritedValue);
51
};
52
53
54
// Logically, AstSimpleProcessing could be derived from
55
// AstPrePostProcessing, but that results in a (barely) measurable
56
// performance hit.
57
class
AstCombinedSimpleProcessing
;
58
59
class
ROSE_DLL_API
AstSimpleProcessing
60
:
public
SgTreeTraversal
<DummyAttribute, DummyAttribute>
61
{
62
public
:
63
typedef
t_traverseOrder
Order
;
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
74
friend
class
AstCombinedSimpleProcessing
;
75
76
protected
:
78
virtual
void
visit
(
SgNode
* astNode) = 0;
79
85
virtual
void
atTraversalStart
();
86
virtual
void
atTraversalEnd
();
87
88
private
:
89
DummyAttribute
evaluateInheritedAttribute
(
SgNode
*astNode,
DummyAttribute
inheritedValue);
90
DummyAttribute
evaluateSynthesizedAttribute
(
SgNode
* astNode,
DummyAttribute
inheritedValue,
91
SynthesizedAttributesList
l);
92
DummyAttribute
defaultSynthesizedAttribute
(
DummyAttribute
inheritedValue);
93
};
94
95
97
class
SgSimpleProcessing
:
public
AstSimpleProcessing
{};
98
99
#endif
rose-edg4x
src
midend
astProcessing
AstSimpleProcessing.h
Generated on Mon May 5 2014 17:28:51 for ROSE by
1.8.4