MimIR
0.4-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.conj
13
///@{
14
enum class
conj
:
flags_t
{
15
};
16
17
const
Def
*
normalize_conj
(
const
Def
*,
const
Def
*,
const
Def
*);
18
///@}
19
20
/// @name %%regex.disj
21
///@{
22
enum class
disj
:
flags_t
{
23
};
24
25
const
Def
*
normalize_disj
(
const
Def
*,
const
Def
*,
const
Def
*);
26
///@}
27
28
/// @name %%regex.range
29
///@{
30
enum class
range
:
flags_t
{
31
};
32
33
const
Def
*
normalize_range
(
const
Def
*,
const
Def
*,
const
Def
*);
34
///@}
35
36
/// @name %%regex.lit
37
///@{
38
enum class
lit
:
flags_t
{
39
};
40
41
///@}
42
43
/// @name %%regex.not_
44
///@{
45
enum class
not_
:
flags_t
{
46
};
47
48
const
Def
*
normalize_not
(
const
Def
*,
const
Def
*,
const
Def
*);
49
///@}
50
51
/// @name %%regex.neg_lookahead
52
///@{
53
enum class
neg_lookahead
:
flags_t
{
54
};
55
56
///@}
57
58
/// @name %%regex.cls
59
///@{
60
enum class
cls
:
flags_t
{
61
d
= 0x4c62066400000600,
62
D
= 0x4c62066400000601,
63
w
= 0x4c62066400000602,
64
W
= 0x4c62066400000603,
65
s = 0x4c62066400000604,
66
S
= 0x4c62066400000605,
67
};
68
69
///@}
70
71
/// @name %%regex.any
72
///@{
73
enum class
any
:
flags_t
{
74
};
75
76
///@}
77
78
/// @name %%regex.empty
79
///@{
80
enum class
empty
:
flags_t
{
81
};
82
83
///@}
84
85
/// @name %%regex.quant
86
///@{
87
enum class
quant
:
flags_t
{
88
optional
= 0x4c62066400000900,
89
star
= 0x4c62066400000901,
90
plus
= 0x4c62066400000902,
91
};
92
93
template
<quant>
94
const
Def
*
normalize_quant
(
const
Def
*,
const
Def
*,
const
Def
*);
95
96
///@}
97
98
/// @name %%regex.lower_regex
99
///@{
100
enum class
lower_regex
:
flags_t
{
101
};
102
103
///@}
104
105
void
register_normalizers
(
Normalizers
& normalizers);
106
107
#define MIM_regex_NORMALIZER_IMPL \
108
void register_normalizers(Normalizers& normalizers) {\
109
normalizers[flags_t(Annex::Base<conj>)] = &normalize_conj; \
110
normalizers[flags_t(Annex::Base<disj>)] = &normalize_disj; \
111
normalizers[flags_t(Annex::Base<range>)] = &normalize_range; \
112
normalizers[flags_t(Annex::Base<not_>)] = &normalize_not; \
113
normalizers[flags_t(quant::optional)] = &normalize_quant<quant::optional>; \
114
normalizers[flags_t(quant::star)] = &normalize_quant<quant::star>; \
115
normalizers[flags_t(quant::plus)] = &normalize_quant<quant::plus>; \
116
}
117
}
// namespace plug::regex
118
119
#ifndef DOXYGEN
// don't include in Doxygen documentation
120
121
template
<>
constexpr
flags_t
Annex::Base<plug::regex::conj>
= 0x4c62066400000000;
122
template
<>
constexpr
size_t
Annex::Num<plug::regex::conj>
= 0;
123
template
<>
constexpr
flags_t
Annex::Base<plug::regex::disj>
= 0x4c62066400000100;
124
template
<>
constexpr
size_t
Annex::Num<plug::regex::disj>
= 0;
125
template
<>
constexpr
flags_t
Annex::Base<plug::regex::range>
= 0x4c62066400000200;
126
template
<>
constexpr
size_t
Annex::Num<plug::regex::range>
= 0;
127
template
<>
constexpr
flags_t
Annex::Base<plug::regex::lit>
= 0x4c62066400000300;
128
template
<>
constexpr
size_t
Annex::Num<plug::regex::lit>
= 0;
129
template
<>
constexpr
flags_t
Annex::Base<plug::regex::not_>
= 0x4c62066400000400;
130
template
<>
constexpr
size_t
Annex::Num<plug::regex::not_>
= 0;
131
template
<>
constexpr
flags_t
Annex::Base<plug::regex::neg_lookahead>
= 0x4c62066400000500;
132
template
<>
constexpr
size_t
Annex::Num<plug::regex::neg_lookahead>
= 0;
133
template
<>
constexpr
flags_t
Annex::Base<plug::regex::cls>
= 0x4c62066400000600;
134
template
<>
constexpr
size_t
Annex::Num<plug::regex::cls>
= 6;
135
template
<>
constexpr
flags_t
Annex::Base<plug::regex::any>
= 0x4c62066400000700;
136
template
<>
constexpr
size_t
Annex::Num<plug::regex::any>
= 0;
137
template
<>
constexpr
flags_t
Annex::Base<plug::regex::empty>
= 0x4c62066400000800;
138
template
<>
constexpr
size_t
Annex::Num<plug::regex::empty>
= 0;
139
template
<>
constexpr
flags_t
Annex::Base<plug::regex::quant>
= 0x4c62066400000900;
140
template
<>
constexpr
size_t
Annex::Num<plug::regex::quant>
= 3;
141
template
<>
constexpr
flags_t
Annex::Base<plug::regex::lower_regex>
= 0x4c62066400000a00;
142
template
<>
constexpr
size_t
Annex::Num<plug::regex::lower_regex>
= 0;
143
144
template
<>
struct
Axm::IsANode
<
plug
::regex::lit> {
using
type
=
Axm
; };
145
template
<>
struct
Axm::IsANode
<
plug
::regex::cls> {
using
type
=
Axm
; };
146
template
<>
struct
Axm::IsANode
<
plug
::regex::any> {
using
type
=
Axm
; };
147
template
<>
struct
Axm::IsANode
<
plug
::regex::empty> {
using
type
=
Axm
; };
148
template
<>
struct
Axm::IsANode
<
plug
::regex::lower_regex> {
using
type
=
Axm
; };
149
150
#endif
151
}
// namespace mim
152
153
#ifndef DOXYGEN
// don't include in Doxygen documentation
154
155
template
<>
struct
fe::is_bit_enum<
mim
::plug::regex::cls> : std::true_type {};
156
template
<>
struct
fe::is_bit_enum<
mim
::plug::regex::quant> : std::true_type {};
157
158
#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:273
mim::plug::regex
The regex Plugin
Definition
lower_regex.h:5
mim::plug::regex::neg_lookahead
neg_lookahead
Definition
autogen.h:53
mim::plug::regex::conj
conj
Definition
autogen.h:14
mim::plug::regex::not_
not_
Definition
autogen.h:45
mim::plug::regex::range
range
Definition
autogen.h:30
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::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:210
mim::plug::regex::empty
empty
Definition
autogen.h:80
mim::plug::regex::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug::regex::any
any
Definition
autogen.h:73
mim::plug::regex::disj
disj
Definition
autogen.h:22
mim::plug::regex::lower_regex
lower_regex
Definition
autogen.h:100
mim::plug::regex::normalize_disj
const Def * normalize_disj(const Def *type, const Def *, const Def *arg)
Definition
normalizers.cpp:156
mim::plug::regex::quant
quant
Definition
autogen.h:87
mim::plug::regex::quant::star
@ star
Definition
autogen.h:89
mim::plug::regex::quant::optional
@ optional
Definition
autogen.h:88
mim::plug::regex::quant::plus
@ plus
Definition
autogen.h:90
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:232
mim::plug::regex::lit
lit
Definition
autogen.h:38
mim::plug::regex::cls
cls
Definition
autogen.h:60
mim::plug::regex::cls::S
@ S
Definition
autogen.h:66
mim::plug::regex::cls::W
@ W
Definition
autogen.h:64
mim::plug::regex::cls::d
@ d
Definition
autogen.h:61
mim::plug::regex::cls::w
@ w
Definition
autogen.h:63
mim::plug::regex::cls::D
@ D
Definition
autogen.h:62
mim::plug
Definition
lower_for.h:5
mim
Definition
ast.h:16
mim::flags_t
u64 flags_t
Definition
types.h:39
mim::Normalizers
absl::flat_hash_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:122
plugin.h
mim::Annex::Num
static constexpr size_t Num
Number of Axm::subtags.
Definition
plugin.h:247
mim::Annex::Base
static constexpr flags_t Base
Definition
plugin.h:248
build
include
mim
plug
regex
autogen.h
Generated by
1.18.0