ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
annotations.h
Go to the documentation of this file.
1 
2 #ifndef BDWY_ANNOTATIONS_H
3 #define BDWY_ANNOTATIONS_H
4 
5 #include <stdio.h>
6 
7 // ------------------------------------------------------------
8 // CLASS: Annotations
9 // ------------------------------------------------------------
10 
11 typedef std::map< std::string, procedureAnn * > procedures_map;
12 typedef procedures_map::iterator procedures_map_p;
13 typedef procedures_map::const_iterator procedures_map_cp;
14 
15 //typedef pair< reportAnn *, stmtNode * > error_pair;
16 //typedef map< error_pair, int > error_report_map;
17 //typedef error_report_map::iterator error_report_map_p;
18 
19 typedef std::list <std::string> str_list;
20 typedef std::set <std::string> str_set;
21 
22 class Adaptor_Statistics;
23 
25 {
26 public:
27 
33  static Annotations * Current;
34 
37  static bool debug;
38 
41  static bool Show_actions;
42 
45  static bool Show_reports;
46 
49  static bool Verbose_properties;
50 
53  static bool Verbose_pointers;
54 
58 
61  static bool Skip_traces;
62 
65  static int Adaptivity;
66 
69  static bool Show_adaptivity;
70 
72  // TB_unify
73  typedef enum { UNIFY, FICI, FSCI, FICS, FSCS } Adapt_Precision;
74 
76 
78  // TB_unify
79  static bool Adapt_uses_uba;
80 
87 
92  static bool Record_tested_objects;
93 
99  static bool Quiet_reports;
100 
108 
114 
119  static double Analysis_time;
120 
124 
128 
131  static unsigned long int Start_brk;
132 
137  static bool Aggressive_pruning;
138 
144  // static error_report_map Error_reports;
145 
151 
153  static bool Diagnostic;
154 
159 
160 private:
161 
164  std::string _filename;
165 
169 
187 
191 
195 
199 
203 
206  int _errors;
207 
213 
214 #ifdef __FOO
215  unitNode * _header;
216 #endif
218 #ifdef __FOO
219  id_lookup_walker * _syms;
220 #endif
221 
223 
224 public:
225 
231  Annotations(std::string & filename, str_list * cpp_flags);
232 
235  ~Annotations();
236 
241  void clear();
242 
245  inline procedureAnn * init() const { return _init; }
246 
249  void add_procedure(procedureAnn * new_procedure);
250 
251 
257  void add_globals(structuretree_list * structures);
258 
266  annVariable * add_one_global(const std::string & varname, bool is_io);
267 
270  void add_enum_property(enumPropertyAnn * property);
271 
274  void add_set_property(setPropertyAnn * set_property);
275 
278  procedureAnn * lookup_procedure(const std::string & name);
279 
282  annVariable * lookup_global(const std::string & name);
283 
286 #ifdef __HEADER
287  declNode * lookup_header_decl(const std::string & name);
288 #endif
289 
292  enumPropertyAnn * lookup_enum_property(const std::string & name);
293 
296  setPropertyAnn * lookup_set_property(const std::string & name);
297 
300  propertyAnn * lookup_property(const std::string & name);
301 
305 
308  void clear_properties();
309 
312  const procedures_map & procedures() const { return _procedures; }
313 
316  const var_map & globals() const { return _globals; }
317 
321 
324  const set_property_map & set_properties() const { return _set_properties; }
325 
328 #ifdef __HEADER
329  void store_header(decl_list * decls);
330 #endif
331 
332  // --- Error handling
333 
334  void Error(int where, const std::string & msg);
335  void Warning(int where, const std::string & msg);
336  int errors() const { return _errors; }
337 
338  // --- Output
339 
340  friend std::ostream& operator<<(std::ostream & o, const Annotations & anns) {
341  anns.print(o);
342  return o;
343  }
344 
345  void print(std::ostream & o) const;
346 
347  std::string & filename() { return _filename; }
348 
349 private:
350 
351  FILE * _open_input_file();
352 
358  annVariable * new_global(const std::string & varname,
359  bool is_external,
360  bool is_io);
361 
366  void old_add_globals(parserid_list * vars);
367 };
368 
369 #endif /* BDWY_ANNOTATIONS_H */