src
rule_rank.h
Go to the documentation of this file.
1 #ifndef _RE2C_IR_RULE_RANK_
2 #define _RE2C_IR_RULE_RANK_
3 
4 #include "src/util/c99_stdint.h"
5 #include <iosfwd>
6 
7 namespace re2c
8 {
9 
10 template <typename num_t> class counter_t;
11 
12 // rule rank public API:
13 // - get rule rank corresponding to nonexistent/default rule
14 // - check if rank corresponds to nonexistent/default rule
15 // - compare ranks
16 // - output rank to std::ostream
17 //
18 // rule rank private API (for rule rank counter):
19 // - get first rank
20 // - get next rank
22 {
23  static const uint32_t NONE;
24  static const uint32_t DEF;
25  uint32_t value;
26  rule_rank_t ();
27  void inc ();
28 
29 public:
30  static rule_rank_t none ();
31  static rule_rank_t def ();
32  bool is_none () const;
33  bool is_def () const;
34  bool operator < (const rule_rank_t & r) const;
35  bool operator == (const rule_rank_t & r) const;
36  friend std::ostream & operator << (std::ostream & o, rule_rank_t r);
37  uint32_t uint32 () const;
38 
39  friend class counter_t<rule_rank_t>;
40 };
41 
42 } // namespace re2c
43 
44 #endif // _RE2C_IR_RULE_RANK_
friend std::ostream & operator<<(std::ostream &o, rule_rank_t r)
Definition: rule_rank.cc:57
bool is_def() const
Definition: rule_rank.cc:42
uint32_t uint32() const
Definition: rule_rank.cc:63
bool is_none() const
Definition: rule_rank.cc:37
static rule_rank_t none()
Definition: rule_rank.cc:23
bool operator==(const rule_rank_t &r) const
Definition: rule_rank.cc:52
static rule_rank_t def()
Definition: rule_rank.cc:30
Definition: bitmap.cc:10
bool operator<(const rule_rank_t &r) const
Definition: rule_rank.cc:47