ROSE  0.9.9.139
arrIndexLabeler.h
1 #ifndef ARR_INDEX_LABELER_H
2 #define ARR_INDEX_LABELER_H
3 
4 #include <sage3.h>
5 #include <list>
6 
7 namespace arrIndexLabeler {
8 
9 // labels the portion of the AST rooted at root with annotations that identify the various portions
10 // the read/write sides of SgAssignOp nodes (if they are)
11 void addArrayIndexAnnotations(SgNode* root);
12 
13 // returns true if the given node is part of an array index expression and false otherwise
14 bool isArrayIndex(SgNode* n);
15 
16 // returns true the given SgPntrArrRefExp node this is a top-level SgPntrArrRefExp that is not part
17 // of a larger SgPntrArrRefExp
18 // (i.e. given a[b[i][j]][k][l], it is either a[b[i][j]][k][l] or b[i][j])
19 bool isTopArrayRefExp(const SgNode* n);
20 
21 // returns the SgExpression node that contains the name of the array in the given SgPntrArrRefExp or
22 // NULL if the node is not a SgPntrArrRefExp
23 SgExpression* getArrayNameExp(SgNode* n);
24 
25 // returns the dimensionality of the array reference in the given SgPntrArrRefExp
26 int getArrayDim(SgPntrArrRefExp* n);
27 
28 // returns the list of index expressionf in the given SgPntrArrRefExp
29  std::list<SgExpression*>& getArrayIndexExprs(SgPntrArrRefExp* n);
30 }
31 #endif
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes, since similar to statement, expressions have a concrete location within the user's source code.
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:8322