1
2
3
4
5
6 #ifndef SNGCPP_AST_SPECIFIER_INCLUDED
7 #define SNGCPP_AST_SPECIFIER_INCLUDED
8 #include <sngcpp/ast/AstApi.hpp>
9 #include <stdint.h>
10 #include <string>
11
12 namespace sngcpp { namespace ast {
13
14 enum class Specifier : uint32_t
15 {
16 none= 0,
17 register_= 1 << 0,
18 static_= 1 << 1,
19 threadLocal= 1 << 2,
20 extern_= 1 << 3,
21 mutable_= 1 << 4,
22 inline_= 1 << 5,
23 virtual_= 1 << 6,
24 explicit_= 1 << 7,
25 override_= 1 << 8,
26 pure_= 1 << 9,
27 final_= 1 << 10,
28 new_= 1 << 11,
29 default_= 1 << 12,
30 delete_= 1 << 13,
31 friend_= 1 << 14,
32 constExpr= 1 << 15,
33 const_= 1 << 16,
34 volatile_= 1 << 17,
35 public_= 1 << 18,
36 protected_= 1 << 19,
37 private_= 1 << 20,
38 extension= 1 << 21,
39 access= public_ | protected_ | private_,
40 virtuality= virtual_ | override_ | pure_
41 };
42
43 constexpr, inlineSpecifier operator|(Specifier left, Specifier right)
44 {
45 return Specifier(uint32_t(left) | uint32_t(right));
46 }
47
48 constexpr, inlineSpecifier operator&(Specifier left, Specifier right)
49 {
50 return Specifier(uint32_t(left) & uint32_t(right));
51 }
52
53 std::u32string SpecifierStr(Specifier specifiers);
54
55 constexpr, inlineSpecifier DeclSpecifierMask()
56 {
57 return Specifier::register_ | Specifier::static_ | Specifier::threadLocal | Specifier::extern_ | Specifier::mutable_ |
58 Specifier::inline_ | Specifier::virtual_ | Specifier::explicit_ |
59 Specifier::friend_ | Specifier::constExpr;
60 }
61
62 constexpr, inlineSpecifier VirtPureSpecifierMask()
63 {
64 return Specifier::override_ | Specifier::final_ | Specifier::new_ | Specifier::pure_;
65 }
66
67 constexpr, inlineSpecifier DefaultDeleteSpecifierMask()
68 {
69 return Specifier::default_ | Specifier::delete_;
70 }
71
72 } }
73
74 #endif // SNGCPP_AST_SPECIFIER_INCLUDED