ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
structure.h
Go to the documentation of this file.
1 
2 #ifndef BDWY_STRUCTURE_H
3 #define BDWY_STRUCTURE_H
4 
5 // ----------------------------------------------------------------------
6 // Structure Annotation
7 // ----------------------------------------------------------------------
8 
9 class structureTreeAnn;
11 
12 typedef std::list<structureAnn * > structure_list;
13 typedef structure_list::iterator structure_list_p;
14 typedef structure_list::const_iterator structure_list_cp;
15 
16 typedef std::list< structureTreeAnn * > structuretree_list;
17 typedef structuretree_list::iterator structuretree_list_p;
18 
31 class structureTreeAnn : public Ann
32 {
33 public:
34 
35  typedef enum { None, Arrow, Dot } Operator;
36 
37 private:
38 
39  std::string _name;
43  bool _is_io;
44 
45 public:
46 
51  Operator op,
52  bool target_is_new);
53 
57  structureTreeAnn * target,
58  Operator op,
59  bool target_is_new);
60 
66 
67  inline std::string & name() { return _name; }
68  inline structuretree_list * targets() { return _targets; }
69  inline Operator op() const { return _operator; }
70  inline bool is_target_new() const { return _target_is_new; }
71  inline bool is_io() const { return _is_io; }
72 
76  void print(int depth = 0) const;
77 
78  private:
79  // DQ (9/13/2011): This copy constructor was built because static analysis tools (made it private to force compile time error if used).
82 
83 };
84 
85 
116 class structureAnn : public Ann
117 {
118 private:
119 
122  std::string _field_name;
123 
124 public:
125 
127  const std::string * field_name,
128  const int line);
129 
130  // --- Fields
131 
132  inline annVariable * source() const { return _source; }
133  inline annVariable * target() const { return _target; }
134  inline const std::string & field_name() const { return _field_name; }
135 
136  // --- Output
137 
138  friend std::ostream& operator<<(std::ostream & o, const structureAnn & sa) {
139  sa.print(o);
140  return o;
141  }
142 
143  void print(std::ostream & o) const;
144 };
145 
146 #endif /* */