ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CreateSlice.h
Go to the documentation of this file.
1 #ifndef _CREATESLICE_H_
2 #define _CREATESLICE_H_
3 
4 /* ! \class CreateSlice
5 
6  This class is a traversal which marks elements that should be in a slice.
7  It does so by accepting a list of nodes that belong in the slice.
8  Currently, it's basically a destructive operation: the ast itself is
9  changed to produce the correct slice.
10 
11  @todo The way that we create the slice is rather... simple. We completely
12  destroy any attendant file info by simply marking everything as compiler
13  generated and then marking the nodes of the slice as to be output. It may
14  be better in the future to create a second AST containing just the nodes of
15  the slice. */
16 // #include "rose.h"
17 #include <set>
18 
20 {
21  public:
23  BooleanSafeKeeper(bool boolVal):boolean(boolVal){};
24  bool boolean;
25 };
26 
27 
28 class ROSE_DLL_API CreateSlice:public AstTopDownBottomUpProcessing < BooleanSafeKeeper,BooleanSafeKeeper>
29 {
30 
31  public:
32 
33  CreateSlice(std::set < SgNode * >saveNodes):_toSave(saveNodes)
34  {
35  }
36 
37  // bool traverse(SgNode * node) {return traverse(node, false);}
38  bool traverse(SgNode * node)
39  {
40  currentFile=NULL;
41 // return traverse(node,BooleanSafeKeeper(false));
43  }
44  protected:
46 
48 
52  {
53  // std::cout<<"DEFAULT SYNTHESIZED ATTRIBUTE CONSTRUCTOR CALLED\n";
54  return inh;
55  }
56  std::stack<std::list<SgNode *> > delayedRemoveListStack;
57  /* virtual bool defaultSynthesizedAttribute()
58  {
59  return false;
60  }
61  virtual bool defaultInheritedAttribute()
62  {
63  return false;
64  } */
65  private:
66 
67  std::set < SgNode * >_toSave;
68 
69 };
70 
71 #endif