src
label.h
Go to the documentation of this file.
1 #ifndef _RE2C_CODEGEN_LABEL_
2 #define _RE2C_CODEGEN_LABEL_
3 
4 #include <iosfwd> // ostream
5 
6 #include "src/util/c99_stdint.h"
7 
8 namespace re2c {
9 
10 template <typename num_t> class counter_t;
11 
12 // label public API:
13 // - get first label
14 // - compare labels
15 // - get label width
16 // - output label to std::ostream
17 //
18 // label private API (for label counter):
19 // - get initial label
20 // - get next label
21 class label_t
22 {
23  static const uint32_t FIRST;
24  uint32_t value;
25  label_t ();
26  void inc ();
27 
28 public:
29  static label_t first ();
30  bool operator < (const label_t & l) const;
31  uint32_t width () const;
32  friend std::ostream & operator << (std::ostream & o, label_t l);
33 
34  friend class counter_t<label_t>;
35 };
36 
37 } // namespace re2c
38 
39 #endif // _RE2C_CODEGEN_LABEL_
uint32_t width() const
Definition: label.cc:28
bool operator<(const label_t &l) const
Definition: label.cc:23
static label_t first()
Definition: label.cc:18
friend std::ostream & operator<<(std::ostream &o, label_t l)
Definition: label.cc:36
Definition: bitmap.cc:10