MimIR
0.5-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
regex.cpp
Go to the documentation of this file.
1
#include "
mim/plug/regex/regex.h
"
2
3
#include <
mim/phase.h
>
4
#include <
mim/plugin.h
>
5
6
#include "
mim/plug/regex/dfa2matcher.h
"
7
#include "
mim/plug/regex/phase/lower_regex.h
"
8
#include "
mim/plug/regex/regex2nfa.h
"
9
10
using namespace
mim
;
11
using namespace
mim::plug
;
12
13
static
void
reg_phases
(
Flags2Phases
& phases) {
Phase::hook<regex::lower_regex, regex::LowerRegex>
(phases); }
14
15
static
const
PluginSym
known_syms
[] = {
16
MIM_PLUGIN_SYM
(
regex2nfa
),
17
MIM_PLUGIN_SYM
(
dfa2matcher
),
18
};
19
20
MIM_PLUGIN_ENTRY
(
regex
) {
21
plugin.register_normalizers =
regex::register_normalizers
;
22
plugin.register_phases =
reg_phases
;
23
plugin.syms =
known_syms
;
24
plugin.num_syms = std::size(
known_syms
);
25
}
mim::Phase::hook
static void hook(Flags2Phases &phases)
Definition
phase.h:51
dfa2matcher.h
dfa2matcher
const mim::Def * dfa2matcher(mim::World &, const automaton::DFA &, const mim::Def *)
You can fe::dl::get this function.
Definition
dfa2matcher.cpp:84
lower_regex.h
mim::plug::regex
The regex Plugin
Definition
lower_regex.h:5
mim::plug::regex::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug
Definition
affine.h:10
mim
Definition
ast.h:16
mim::Flags2Phases
ankerl::unordered_dense::map< flags_t, std::function< std::unique_ptr< Phase >(World &)> > Flags2Phases
Maps an axiom of a Phase to a function that creates one.
Definition
plugin.h:30
mim::PluginSym
One symbol a Plugin offers to other Plugins; see Driver::get_fun_ptr.
Definition
plugin.h:48
phase.h
plugin.h
MIM_PLUGIN_SYM
#define MIM_PLUGIN_SYM(f)
Builds a PluginSym for f, so name and address cannot drift apart.
Definition
plugin.h:54
MIM_PLUGIN_ENTRY
#define MIM_PLUGIN_ENTRY(p)
Defines a Plugin's entry point; the body fills in the plugin handed to it, as in MIM_PLUGIN_ENTRY(dem...
Definition
plugin.h:196
regex2nfa.h
regex2nfa
automaton::NFA * regex2nfa(const mim::Def *regex)
You can fe::dl::get this function.
Definition
regex2nfa.cpp:137
known_syms
static const PluginSym known_syms[]
Definition
regex.cpp:15
reg_phases
static void reg_phases(Flags2Phases &phases)
Definition
regex.cpp:13
regex.h
src
mim
plug
regex
regex.cpp
Generated by
1.18.0