MimIR
0.5-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
mim/axm.h
>
4
#include <
mim/plugin.h
>
5
6
/// @namespace mim::plug::regex @ref regex
7
namespace
mim
{
8
namespace
plug::regex
{
9
10
static
constexpr
plugin_t
Plugin_Id
= 0x4c62066400000000;
11
12
/// @name `regex.Pos`
13
///@{
14
enum class
Pos
:
flags_t
{
15
};
16
17
///@}
18
19
/// @name `regex.pos`
20
///@{
21
enum class
pos
:
flags_t
{
22
};
23
24
///@}
25
26
/// @name `regex.Res`
27
///@{
28
enum class
Res
:
flags_t
{
29
};
30
31
///@}
32
33
/// @name `regex.RE`
34
///@{
35
enum class
RE
:
flags_t
{
36
};
37
38
///@}
39
40
/// @name `regex.conj`
41
///@{
42
enum class
conj
:
flags_t
{
43
};
44
45
const
Def
*
normalize_conj
(
const
Def
*,
const
Def
*,
const
Def
*);
46
///@}
47
48
/// @name `regex.disj`
49
///@{
50
enum class
disj
:
flags_t
{
51
};
52
53
const
Def
*
normalize_disj
(
const
Def
*,
const
Def
*,
const
Def
*);
54
///@}
55
56
/// @name `regex.range`
57
///@{
58
enum class
range
:
flags_t
{
59
};
60
61
const
Def
*
normalize_range
(
const
Def
*,
const
Def
*,
const
Def
*);
62
///@}
63
64
/// @name `regex.lit`
65
///@{
66
enum class
lit
:
flags_t
{
67
};
68
69
///@}
70
71
/// @name `regex.not`
72
///@{
73
enum class
not_
:
flags_t
{
74
};
75
76
const
Def
*
normalize_not
(
const
Def
*,
const
Def
*,
const
Def
*);
77
///@}
78
79
/// @name `regex.neg_lookahead`
80
///@{
81
enum class
neg_lookahead
:
flags_t
{
82
};
83
84
///@}
85
86
/// @name `regex.cls`
87
///@{
88
enum class
cls
:
flags_t
{
89
d
= 0x4c62066400000a00,
90
D
= 0x4c62066400000a01,
91
w
= 0x4c62066400000a02,
92
W
= 0x4c62066400000a03,
93
s = 0x4c62066400000a04,
94
S
= 0x4c62066400000a05,
95
};
96
97
///@}
98
99
/// @name `regex.any`
100
///@{
101
enum class
any
:
flags_t
{
102
};
103
104
///@}
105
106
/// @name `regex.empty`
107
///@{
108
enum class
empty
:
flags_t
{
109
};
110
111
///@}
112
113
/// @name `regex.quant`
114
///@{
115
enum class
quant
:
flags_t
{
116
optional
= 0x4c62066400000d00,
117
star
= 0x4c62066400000d01,
118
plus
= 0x4c62066400000d02,
119
};
120
121
template
<quant>
122
const
Def
*
normalize_quant
(
const
Def
*,
const
Def
*,
const
Def
*);
123
124
///@}
125
126
/// @name `regex.lower_regex`
127
///@{
128
enum class
lower_regex
:
flags_t
{
129
};
130
131
///@}
132
133
void
register_normalizers
(
Normalizers
& normalizers);
134
135
#define MIM_regex_NORMALIZER_IMPL \
136
void register_normalizers(Normalizers& normalizers) {\
137
normalizers[flags_t(Annex::Base<conj>)] = &normalize_conj; \
138
normalizers[flags_t(Annex::Base<disj>)] = &normalize_disj; \
139
normalizers[flags_t(Annex::Base<range>)] = &normalize_range; \
140
normalizers[flags_t(Annex::Base<not_>)] = &normalize_not; \
141
normalizers[flags_t(quant::optional)] = &normalize_quant<quant::optional>; \
142
normalizers[flags_t(quant::star)] = &normalize_quant<quant::star>; \
143
normalizers[flags_t(quant::plus)] = &normalize_quant<quant::plus>; \
144
}
145
}
// namespace plug::regex
146
147
#ifndef DOXYGEN
// don't include in Doxygen documentation
148
149
template
<>
constexpr
flags_t
Annex::Base<plug::regex::Pos>
= 0x4c62066400000000;
150
template
<>
constexpr
size_t
Annex::Num<plug::regex::Pos>
= 0;
151
template
<>
constexpr
flags_t
Annex::Base<plug::regex::pos>
= 0x4c62066400000100;
152
template
<>
constexpr
size_t
Annex::Num<plug::regex::pos>
= 0;
153
template
<>
constexpr
flags_t
Annex::Base<plug::regex::Res>
= 0x4c62066400000200;
154
template
<>
constexpr
size_t
Annex::Num<plug::regex::Res>
= 0;
155
template
<>
constexpr
flags_t
Annex::Base<plug::regex::RE>
= 0x4c62066400000300;
156
template
<>
constexpr
size_t
Annex::Num<plug::regex::RE>
= 0;
157
template
<>
constexpr
flags_t
Annex::Base<plug::regex::conj>
= 0x4c62066400000400;
158
template
<>
constexpr
size_t
Annex::Num<plug::regex::conj>
= 0;
159
template
<>
constexpr
flags_t
Annex::Base<plug::regex::disj>
= 0x4c62066400000500;
160
template
<>
constexpr
size_t
Annex::Num<plug::regex::disj>
= 0;
161
template
<>
constexpr
flags_t
Annex::Base<plug::regex::range>
= 0x4c62066400000600;
162
template
<>
constexpr
size_t
Annex::Num<plug::regex::range>
= 0;
163
template
<>
constexpr
flags_t
Annex::Base<plug::regex::lit>
= 0x4c62066400000700;
164
template
<>
constexpr
size_t
Annex::Num<plug::regex::lit>
= 0;
165
template
<>
constexpr
flags_t
Annex::Base<plug::regex::not_>
= 0x4c62066400000800;
166
template
<>
constexpr
size_t
Annex::Num<plug::regex::not_>
= 0;
167
template
<>
constexpr
flags_t
Annex::Base<plug::regex::neg_lookahead>
= 0x4c62066400000900;
168
template
<>
constexpr
size_t
Annex::Num<plug::regex::neg_lookahead>
= 0;
169
template
<>
constexpr
flags_t
Annex::Base<plug::regex::cls>
= 0x4c62066400000a00;
170
template
<>
constexpr
size_t
Annex::Num<plug::regex::cls>
= 6;
171
template
<>
constexpr
flags_t
Annex::Base<plug::regex::any>
= 0x4c62066400000b00;
172
template
<>
constexpr
size_t
Annex::Num<plug::regex::any>
= 0;
173
template
<>
constexpr
flags_t
Annex::Base<plug::regex::empty>
= 0x4c62066400000c00;
174
template
<>
constexpr
size_t
Annex::Num<plug::regex::empty>
= 0;
175
template
<>
constexpr
flags_t
Annex::Base<plug::regex::quant>
= 0x4c62066400000d00;
176
template
<>
constexpr
size_t
Annex::Num<plug::regex::quant>
= 3;
177
template
<>
constexpr
flags_t
Annex::Base<plug::regex::lower_regex>
= 0x4c62066400000e00;
178
template
<>
constexpr
size_t
Annex::Num<plug::regex::lower_regex>
= 0;
179
180
template
<>
struct
Axm::IsANode
<
plug
::regex::Pos> {
using
type
=
Axm
; };
181
template
<>
struct
Axm::IsANode
<
plug
::regex::pos> {
using
type
=
Axm
; };
182
template
<>
struct
Axm::IsANode
<
plug
::regex::Res> {
using
type
=
Axm
; };
183
template
<>
struct
Axm::IsANode
<
plug
::regex::RE> {
using
type
=
Axm
; };
184
template
<>
struct
Axm::IsANode
<
plug
::regex::lit> {
using
type
=
Axm
; };
185
template
<>
struct
Axm::IsANode
<
plug
::regex::cls> {
using
type
=
Axm
; };
186
template
<>
struct
Axm::IsANode
<
plug
::regex::any> {
using
type
=
Axm
; };
187
template
<>
struct
Axm::IsANode
<
plug
::regex::empty> {
using
type
=
Axm
; };
188
template
<>
struct
Axm::IsANode
<
plug
::regex::lower_regex> {
using
type
=
Axm
; };
189
190
#endif
191
}
// namespace mim
192
193
#ifndef DOXYGEN
// don't include in Doxygen documentation
194
195
template
<>
struct
fe::is_bit_enum<
mim
::plug::regex::cls> : std::true_type {};
196
template
<>
struct
fe::is_bit_enum<
mim
::plug::regex::quant> : std::true_type {};
197
198
#endif
axm.h
mim::Axm::IsANode::type
App type
Definition
axm.h:70
mim::Axm::IsANode
Definition
axm.h:69
mim::Def
Base class for all Defs.
Definition
def.h:289
mim::plug::regex
The regex Plugin
Definition
lower_regex.h:5
mim::plug::regex::neg_lookahead
neg_lookahead
Definition
autogen.h:81
mim::plug::regex::conj
conj
Definition
autogen.h:42
mim::plug::regex::not_
not_
Definition
autogen.h:73
mim::plug::regex::range
range
Definition
autogen.h:58
mim::plug::regex::normalize_conj
const Def * normalize_conj(const Def *type, const Def *callee, const Def *arg)
Definition
normalizers.cpp:58
mim::plug::regex::Pos
Pos
Definition
autogen.h:14
mim::plug::regex::Plugin_Id
static constexpr plugin_t Plugin_Id
Definition
autogen.h:10
mim::plug::regex::normalize_range
const Def * normalize_range(const Def *type, const Def *callee, const Def *arg)
Definition
normalizers.cpp:199
mim::plug::regex::empty
empty
Definition
autogen.h:108
mim::plug::regex::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug::regex::Res
Res
Definition
autogen.h:28
mim::plug::regex::any
any
Definition
autogen.h:101
mim::plug::regex::pos
pos
Definition
autogen.h:21
mim::plug::regex::disj
disj
Definition
autogen.h:50
mim::plug::regex::lower_regex
lower_regex
Definition
autogen.h:128
mim::plug::regex::RE
RE
Definition
autogen.h:35
mim::plug::regex::normalize_disj
const Def * normalize_disj(const Def *type, const Def *, const Def *arg)
Definition
normalizers.cpp:153
mim::plug::regex::quant
quant
Definition
autogen.h:115
mim::plug::regex::quant::star
@ star
Definition
autogen.h:117
mim::plug::regex::quant::optional
@ optional
Definition
autogen.h:116
mim::plug::regex::quant::plus
@ plus
Definition
autogen.h:118
mim::plug::regex::normalize_quant
const Def * normalize_quant(const Def *type, const Def *callee, const Def *arg)
Definition
normalizers.cpp:23
mim::plug::regex::normalize_not
const Def * normalize_not(const Def *, const Def *callee, const Def *arg)
Definition
normalizers.cpp:218
mim::plug::regex::lit
lit
Definition
autogen.h:66
mim::plug::regex::cls
cls
Definition
autogen.h:88
mim::plug::regex::cls::S
@ S
Definition
autogen.h:94
mim::plug::regex::cls::W
@ W
Definition
autogen.h:92
mim::plug::regex::cls::d
@ d
Definition
autogen.h:89
mim::plug::regex::cls::w
@ w
Definition
autogen.h:91
mim::plug::regex::cls::D
@ D
Definition
autogen.h:90
mim::plug
Definition
affine.h:10
mim
Definition
ast.h:16
mim::flags_t
u64 flags_t
Definition
types.h:39
mim::Normalizers
ankerl::unordered_dense::map< flags_t, NormalizeFn > Normalizers
Definition
plugin.h:27
mim::plugin_t
u64 plugin_t
Definition
types.h:40
mim::Node::Axm
@ Axm
Definition
def.h:125
plugin.h
mim::Annex::Num
static constexpr size_t Num
Number of Axm::subtags.
Definition
plugin.h:273
mim::Annex::Base
static constexpr flags_t Base
Definition
plugin.h:274
build
include
mim
plug
regex
autogen.h
Generated by
1.18.0