source: CMT/v1r23/source/cmt_tag.h

Last change on this file was 568, checked in by rybkin, 13 years ago

See C.L. 451

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1//-----------------------------------------------------------
2// Copyright Christian Arnault LAL-Orsay CNRS
3// arnault@lal.in2p3.fr
4// See the complete license in cmt_license.txt "http://www.cecill.info".
5//-----------------------------------------------------------
6
7#ifndef __cmt_tag_h__
8#define __cmt_tag_h__
9
10#include "cmt_parser.h"
11#include "cmt_system.h"
12#include "cmt_use.h"
13#include "cmt_map.h"
14
15class Tag
16{
17public:
18  typedef cmt_map<cmt_string, Tag> TagMap;
19  typedef cmt_vector<Tag> TagVector;
20  typedef cmt_vector<Tag*> TagPtrVector;
21
22  static void action (const CmtSystem::cmt_string_vector& words, Use* use);
23  static void action_apply (const CmtSystem::cmt_string_vector& words, Use* use);
24  static void action_exclude (const CmtSystem::cmt_string_vector& words, Use* use);
25  static Tag* find (const cmt_string& name, TagMap& instances);
26  static Tag* find (const cmt_string& name);
27  static Tag* add (const cmt_string& name, int priority,
28                   const cmt_string& context, Use* use = 0);
29  static int tag_number ();
30  static Tag* tag (int index);
31  static void unmark_all ();
32  static void restore_tree ();
33  static void clear_all ();
34
35  static TagMap& tag_map ();
36  static TagVector& all_tags ();
37  static TagPtrVector& tags ();
38
39  static Tag* get_default ();
40
41  static bool check_tag_used (const Tag* tag);
42
43public:
44  Tag ();
45  Tag (const Tag& other);
46  Tag& operator = (const Tag& other);
47  ~Tag ();
48  void clear ();
49  void add_tag_ref (Tag* ref);
50  void add_tag_exclude (Tag* ref);
51  void add_ref_use (Use* use);
52  void unmark ();
53  void mark (const cmt_string& context);
54  //void mark ();
55  void show_definition (bool quiet, ostream& out = cout,
56                        const cmt_string& prefix = "") const;
57  //  void show_definition (bool quiet) const;
58  void show (bool quiet, ostream& out = cout, const cmt_string& prefix = "") const;
59  //  void show (bool quiet) const;
60  bool is_selected () const;
61  bool is_primary () const;
62  const cmt_string& get_name () const;
63  int get_priority () const;
64  void install (TagMap& instances);
65  bool use_operand (const Tag* other) const;
66  bool use_ref (const Tag* other) const;
67
68private:
69  cmt_string m_name;
70  bool m_selected;
71  TagPtrVector m_and_operands;
72  TagPtrVector m_tag_refs;
73  TagPtrVector m_tag_excludes;
74  cmt_string m_context;
75  Use* m_def_use;
76  Use* m_set_use;
77  cmt_string m_act_context;
78  Use::UsePtrVector m_ref_uses;
79  int m_priority;
80  ScopeType scope;
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.