30
30
class CFunctionInfo;
31
31
} // namespace Puma
33
class JoinPointLocList;
35
35
class TrackerDog : public CVisitor {
36
36
CTranslationUnit &_tunit;
37
JoinPointLocList &_world;
38
38
CT_BinaryExpr *assignment;
39
39
CT_InitDeclarator *last_init_declarator;
40
40
Stack<CFunctionInfo*> func_stack;
44
void pseudo_jps (JoinPointLocList &jpll);
45
44
CClassDatabase &db () { return _tunit.db (); }
47
46
virtual void pre_visit (CTree *node);
50
49
void pre_PointcutDecl (CT_PointcutDecl *node);
51
50
void pre_AdviceDecl (CT_AdviceDecl *node);
52
void pre_CallExpr (CT_CallExpr *node);
51
void pre_Call (CT_Call *node);
53
52
void pre_FctDef (CT_FctDef *node);
54
53
void post_FctDef (CT_FctDef *node);
55
/* void pre_MemPtrExpr (CpppAst_MemPtrExpr *node); */
56
/* void pre_MemRefExpr (CpppAst_MemRefExpr *node); */
57
/* void pre_SimpleName (CpppAst_SimpleName *node); */
58
/* void pre_QualName (CpppAst_QualName *node); */
59
/* void pre_RootQualName (CpppAst_RootQualName *node); */
60
void pre_InitDeclarator (CT_InitDeclarator *node);
61
void post_InitDeclarator (CT_InitDeclarator *node);
63
/* bool get_or_set (CpppAstInfo *node, CpppAst_SimpleName *field); */
64
/* TN_AttributeInfo *attribute (CpppAst_SimpleName *name); */
65
/* void dump_node (CpppAstInfo *node); */
54
void pre_InitDeclarator (CT_InitDeclarator *node);
55
void post_InitDeclarator (CT_InitDeclarator *node);
56
void pre_MembPtrExpr (CT_MembPtrExpr *node);
57
void pre_SimpleName (CT_SimpleName *node);
58
void pre_NamespaceDef (CT_NamespaceDef *node);
59
void pre_ClassDef (CT_ClassDef *node);
60
void post_ClassDef (CT_ClassDef *node);
61
bool register_access (CObjectInfo *obj, CTree *node);
69
TrackerDog (CTranslationUnit &tunit, JoinPointLocList &jpll):
70
_tunit (tunit), _world (jpll), assignment (0), last_init_declarator (0),
65
TrackerDog (CTranslationUnit &tunit, ModelBuilder &jpm):
66
_tunit (tunit), _jpm (jpm), assignment (0), last_init_declarator (0),
71
67
in_memb_init (false) {
72
68
func_stack.push ((CFunctionInfo*)0);
74
70
virtual ~TrackerDog() {}
76
72
// search all code join points
78
// first insert pseudo joinpoints into the joinpoint location list
80
// now find real joinpoints
81
visit (_tunit.tree ());
73
void run () { visit (_tunit.tree ()); }
74
void run (CTree *tree) { visit (tree); }
84
76
// check if a function should be considered by ac++
85
77
static CFunctionInfo *filter_func (CFunctionInfo* fi);