source: CMT/v1r14p20031120/src/cmt_tag.h @ 1

Last change on this file since 1 was 1, checked in by arnault, 19 years ago

Import all tags

File size: 1.7 KB
Line 
1#ifndef __cmt_tag_h__
2#define __cmt_tag_h__
3
4#include "cmt_parser.h"
5#include "cmt_system.h"
6#include "cmt_use.h"
7#include "cmt_map.h"
8
9class Tag
10{
11public:
12  typedef cmt_map<cmt_string, Tag> TagMap;
13  typedef cmt_vector<Tag> TagVector;
14  typedef cmt_vector<Tag*> TagPtrVector;
15
16  static void action (const CmtSystem::cmt_string_vector& words, Use* use);
17  static void action_apply (const CmtSystem::cmt_string_vector& words, Use* use);
18  static void action_exclude (const CmtSystem::cmt_string_vector& words, Use* use);
19  static Tag* find (const cmt_string& name, TagMap& instances);
20  static Tag* find (const cmt_string& name);
21  static Tag* add (const cmt_string& name, int priority,
22                   const cmt_string& context, Use* use = 0);
23  static int tag_number ();
24  static Tag* tag (int index);
25  static void unmark_all ();
26  static void restore_tree ();
27  static void clear_all ();
28
29  static TagMap& tag_map ();
30  static TagVector& all_tags ();
31  static TagPtrVector& tags ();
32
33  static Tag* get_default ();
34
35public:
36  Tag ();
37  Tag (const Tag& other);
38  Tag& operator = (const Tag& other);
39  ~Tag ();
40  void clear ();
41  void add_tag_ref (Tag* ref);
42  void add_tag_exclude (Tag* ref);
43  void unmark ();
44  void mark ();
45  void show_definition (bool quiet) const;
46  void show (bool quiet) const;
47  bool is_selected () const;
48  bool is_primary () const;
49  const cmt_string& get_name () const;
50  int get_priority () const;
51  void install (TagMap& instances);
52
53private:
54  cmt_string m_name;
55  bool m_selected;
56  TagPtrVector m_and_operands;
57  TagPtrVector m_tag_refs;
58  TagPtrVector m_tag_excludes;
59  cmt_string m_context;
60  Use* m_def_use;
61  Use* m_set_use;
62  int m_priority;
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.