MimIR
0.4-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
regex.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <type_traits>
4
5
#include "
mim/plug/regex/autogen.h
"
6
7
namespace
mim::plug::regex::detail {
8
template
<
class
ConjOrDisj>
9
void
flatten_in_arg(
const
Def* arg,
DefVec
& new_args) {
10
for
(
const
auto
* proj : arg->projs()) {
11
// flatten conjs in conjs / disj in disjs
12
if
(
auto
seq_app =
Axm::isa<ConjOrDisj>
(proj))
13
flatten_in_arg<ConjOrDisj>(seq_app->arg(), new_args);
14
else
{
15
if
constexpr
(std::is_same_v<ConjOrDisj, conj>)
16
if
(
Axm::isa<regex::empty>
(proj))
continue
;
17
new_args.push_back(proj);
18
}
19
}
20
}
21
22
template
<
class
ConjOrDisj>
23
DefVec
flatten_in_arg(
const
Def* arg) {
24
DefVec
new_args;
25
flatten_in_arg<ConjOrDisj>(arg, new_args);
26
return
new_args;
27
}
28
}
// namespace mim::plug::regex::detail
mim::Axm::isa
static auto isa(const Def *def)
Definition
axm.h:112
mim::DefVec
fe::Vector< const Def * > DefVec
Definition
def.h:93
autogen.h
include
mim
plug
regex
regex.h
Generated by
1.18.0