ROSE
0.9.6a
|
#include <MarkingNodes.h>
Public Member Functions | |
void | initialize (set< SgNode * > s, SgFunctionDefinition *func) |
set< SgNode * > | get_newStatementList () |
list< SgFunctionDeclaration * > | get_funclist () |
![]() | |
bool | traverse (SgNode *node, boolinheritedValue) |
evaluates attributes on the entire AST More... | |
bool | traverseWithinFile (SgNode *node, boolinheritedValue) |
evaluates attributes only at nodes which represent the same file as where the evaluation was started More... | |
![]() | |
bool | traverse (SgNode *basenode, boolinheritedValue, t_traverseOrder travOrder=preandpostorder) |
bool | traverseWithinFile (SgNode *basenode, boolinheritedValue, t_traverseOrder travOrder=preandpostorder) |
void | traverseInputFiles (SgProject *projectNode, boolinheritedValue, t_traverseOrder travOrder=preandpostorder) |
virtual | ~SgTreeTraversal () |
SgTreeTraversal () | |
SgTreeTraversal (const SgTreeTraversal &) | |
const SgTreeTraversal & | operator= (const SgTreeTraversal &) |
Static Public Member Functions | |
static void | checkIfDeclared (SgNode *node, bool keep) |
Protected Member Functions | |
void | keepAllNodes (SgNode *node) |
void | insertInList (SgNode *node) |
bool | isAlreadyInSet (SgNode *node) |
virtual bool | evaluateInheritedAttribute (SgNode *astNode, bool inherited) |
virtual bool | evaluateSynthesizedAttribute (SgNode *astNode, bool inherited, vector< bool > synattri) |
bool | defaultSynthesizedAttribute () |
![]() | |
virtual bool | evaluateSynthesizedAttribute (SgNode *, bool, SynthesizedAttributesList)=0 |
pure virtual function which must be implemented to compute the synthesized attribute at a node. More... | |
virtual void | atTraversalStart () |
Function called at the start of the traversal, before any node is visited; override if necessary, the default implementation is a no-op. More... | |
virtual void | atTraversalEnd () |
![]() | |
virtual void | setNodeSuccessors (SgNode *node, SuccessorsContainer &succContainer) |
virtual bool | defaultSynthesizedAttribute (boolinh) |
void | set_useDefaultIndexBasedTraversal (bool) |
Static Protected Member Functions | |
static void | keepNode (SgNode *node) |
Protected Attributes | |
set< SgNode * > | stmtlist |
set< SgNode * > | newStmtlist |
The input list of statements that we are to have in our slice. More... | |
set< SgNode * > | allreturnedstmts |
Output list of statements that need to be included. More... | |
SgFunctionDefinition * | sliceThisFunc |
list< SgFunctionDeclaration * > | funclist |
bool | beforePragma |
Additional Inherited Members | |
![]() | |
typedef SgTreeTraversal< bool, bool > ::SynthesizedAttributesList | SynthesizedAttributesList |
typedef SynthesizedAttributesList | SubTreeSynthesizedAttributes |
![]() | |
typedef AstSuccessorsSelectors::SuccessorsContainer | SuccessorsContainer |
typedef SuccessorsContainer & | SuccessorsContainerRef |
MarkingNodes is a subclass of AstTopDownBottomUpProcessing. In this traversal AST nodes are marked according to if the are to be or not to be in the slice: Each AST node is compared to the with the list of statements that are to be in the slice. If an AST node is found in the list of statements, then the subtree with this node as its root is marked with the attribute keep=true, and also a synthesized attribute is "sent" up in the tree, such that we mark all nodes "above" the current node with the attribute keep=true.
Definition at line 36 of file MarkingNodes.h.
|
protected |
This function marks all nodes in the subtree with node as the root to be kept.
|
staticprotected |
This function adds the AstAttribute keep to the node and sets the value of the attribute to be true.
|
protected |
This function inserts the node in the list which we return in get_newStatementList().
|
protected |
This function checks if the node is already in two sets: 1) the set of statements returning from the current travesal 2) the set of all statements ever returned from a traversal. The latter set is to avoid to include a statement that is already known to be kept, and thus avoid never-ending loops in the function FindStatementsForSlice().
node | - the node which is to be tested if it is in the set of new statements we are finding from the control structures and if it is in the set of all statements found for the slice ever found. |
void MarkingNodes::initialize | ( | set< SgNode * > | s, |
SgFunctionDefinition * | func | ||
) |
This function sets the statement list. It also clears the list containing the "new"(i.e. the statements we collect in this traversal) statements, as well as the bool beforePragma to be true as a default.
|
inline |
This function returns the list of new statements for which we need to find all statements that affect them.
Definition at line 91 of file MarkingNodes.h.
References newStmtlist.
|
inline |
This function returns the list of function declarations which are to be in the slice. (Not complete from this marking traversal. We also need to find possible function calls within these functions recursively.)
Definition at line 97 of file MarkingNodes.h.
References funclist.
|
static |
If the boolean keep is true, then this function checks that the SgNode node is declared/defined properly. This means the functions checks if the definition AST node of the variable which occurs at node has the AstAttribute "keep".
If the boolean value keep is false, this SgNode is not to be included in the slice and thus does not need to be defined/declared properly.
node | - the node that is to be checked if is declared properly. |
keep | - a boolean value that tells us whether this check is necessary or not. |
|
protectedvirtual |
This function implements the virtual function "evaluateInheritedAttribute" in the class AstTopDownBottomUpProcessing. In this function marking of statements which are to be kept for the slice is done. (more specific?)
Implements AstTopDownBottomUpProcessing< bool, bool >.
|
protectedvirtual |
This function implements the virtual function "evaluateSynthesizedAttribute" in the class AstTopDownBottomUpProcessing.
|
protected |
This function implements the virtual function "defaultSynthesizedAttribute" in the class AstTopDownBottomUpProcessing. The default return value is "false", implying that the default answer to whether an AST node is to be kept for the slice or not, is not to keep.
|
protected |
Definition at line 40 of file MarkingNodes.h.
|
protected |
The input list of statements that we are to have in our slice.
Definition at line 41 of file MarkingNodes.h.
Referenced by get_newStatementList().
|
protected |
Output list of statements that need to be included.
Definition at line 42 of file MarkingNodes.h.
|
protected |
Definition at line 43 of file MarkingNodes.h.
|
protected |
Definition at line 44 of file MarkingNodes.h.
Referenced by get_funclist().
|
protected |
A variable that tells us if we are before the first pragma declaration in the code.
Definition at line 77 of file MarkingNodes.h.