MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::plug::regex Namespace Reference

The regex Plugin More...

Classes

struct  app_range
class  LowerRegex
 Lowers a regex axm application to a DFA matcher function. More...

Enumerations

<tt>regex.Pos</tt>
enum class  Pos : flags_t
enum class  pos : flags_t
<tt>regex.Res</tt>
enum class  Res : flags_t
<tt>regex.RE</tt>
enum class  RE : flags_t
<tt>regex.lit</tt>
enum class  lit : flags_t
<tt>regex.neg_lookahead</tt>
enum class  neg_lookahead : flags_t
<tt>regex.cls</tt>
enum class  cls : flags_t {
  d = 0x4c62066400000a00 ,
  D = 0x4c62066400000a01 ,
  w = 0x4c62066400000a02 ,
  W = 0x4c62066400000a03 ,
  s = 0x4c62066400000a04 ,
  S = 0x4c62066400000a05
}
<tt>regex.any</tt>
enum class  any : flags_t
<tt>regex.empty</tt>
enum class  empty : flags_t
<tt>regex.lower_regex</tt>
enum class  lower_regex : flags_t

Functions

std::unique_ptr< automaton::NFA > regex2nfa (const Def *regex)
std::unique_ptr< automaton::NFA > regex2nfa (decltype(::regex2nfa) *fptr, const Def *regex)
template<class ConjOrDisj>
const Def * make_binary_tree (Defs args)
const App * lit_range (const Def *d)
bool compare_re (const Def *lhs, const Def *rhs)
void make_vector_unique (DefVec &args)
auto get_range (const Def *rng) -> Range
void merge_ranges (DefVec &args)
bool equals_any (const Def *lhs, const Def *rhs)
bool equals_any (Defs lhs, Defs negated_rhs)
const Def * any_unwanted_for_not (const Def *arg)
void register_normalizers (Normalizers &normalizers)

Variables

static constexpr plugin_t Plugin_Id = 0x4c62066400000000

<tt>regex.conj</tt>

enum class  conj : flags_t
const Def * normalize_conj (const Def *type, const Def *callee, const Def *arg)

<tt>regex.disj</tt>

enum class  disj : flags_t
const Def * normalize_disj (const Def *type, const Def *, const Def *arg)

<tt>regex.range</tt>

enum class  range : flags_t
const Def * normalize_range (const Def *type, const Def *callee, const Def *arg)

<tt>regex.not</tt>

enum class  not_ : flags_t
const Def * normalize_not (const Def *, const Def *callee, const Def *arg)

<tt>regex.quant</tt>

enum class  quant : flags_t {
  optional = 0x4c62066400000d00 ,
  star = 0x4c62066400000d01 ,
  plus = 0x4c62066400000d02
}
template<quant id>
const Def * normalize_quant (const Def *type, const Def *callee, const Def *arg)

Detailed Description

Enumeration Type Documentation

◆ any

enum class mim::plug::regex::any : flags_t
strong

Definition at line 101 of file autogen.h.

◆ cls

enum class mim::plug::regex::cls : flags_t
strong
Enumerator
d 
D 
w 
W 
s 
S 

Definition at line 88 of file autogen.h.

◆ conj

enum class mim::plug::regex::conj : flags_t
strong

Definition at line 42 of file autogen.h.

◆ disj

enum class mim::plug::regex::disj : flags_t
strong

Definition at line 50 of file autogen.h.

◆ empty

enum class mim::plug::regex::empty : flags_t
strong

Definition at line 108 of file autogen.h.

◆ lit

enum class mim::plug::regex::lit : flags_t
strong

Definition at line 66 of file autogen.h.

◆ lower_regex

Definition at line 128 of file autogen.h.

◆ neg_lookahead

Definition at line 81 of file autogen.h.

◆ not_

enum class mim::plug::regex::not_ : flags_t
strong

Definition at line 73 of file autogen.h.

◆ Pos

enum class mim::plug::regex::Pos : flags_t
strong

Definition at line 14 of file autogen.h.

◆ pos

enum class mim::plug::regex::pos : flags_t
strong

Definition at line 21 of file autogen.h.

◆ quant

enum class mim::plug::regex::quant : flags_t
strong
Enumerator
optional 
star 
plus 

Definition at line 115 of file autogen.h.

◆ range

enum class mim::plug::regex::range : flags_t
strong

Definition at line 58 of file autogen.h.

◆ RE

enum class mim::plug::regex::RE : flags_t
strong

Definition at line 35 of file autogen.h.

◆ Res

enum class mim::plug::regex::Res : flags_t
strong

Definition at line 28 of file autogen.h.

Function Documentation

◆ any_unwanted_for_not()

const Def * mim::plug::regex::any_unwanted_for_not ( const Def * arg)

Definition at line 208 of file normalizers.cpp.

References any_unwanted_for_not(), and mim::Axm::isa().

Referenced by any_unwanted_for_not(), and normalize_not().

◆ compare_re()

bool mim::plug::regex::compare_re ( const Def * lhs,
const Def * rhs )

Definition at line 82 of file normalizers.cpp.

References mim::Lit::as(), compare_re(), mim::Def::gid(), and lit_range().

Referenced by compare_re(), and make_vector_unique().

◆ equals_any() [1/2]

bool mim::plug::regex::equals_any ( const Def * lhs,
const Def * rhs )

Definition at line 132 of file normalizers.cpp.

References equals_any(), and mim::Axm::isa().

Referenced by equals_any(), equals_any(), and normalize_disj().

◆ equals_any() [2/2]

bool mim::plug::regex::equals_any ( Defs lhs,
Defs negated_rhs )

Definition at line 144 of file normalizers.cpp.

References equals_any(), get_range(), and lit_range().

◆ get_range()

auto mim::plug::regex::get_range ( const Def * rng) -> Range

Definition at line 102 of file normalizers.cpp.

References mim::Lit::as(), get_range(), and mim::Axm::isa().

Referenced by equals_any(), get_range(), and merge_ranges().

◆ lit_range()

const App * mim::plug::regex::lit_range ( const Def * d)

Definition at line 77 of file normalizers.cpp.

References d, mim::Axm::isa(), and lit_range().

Referenced by compare_re(), equals_any(), lit_range(), and merge_ranges().

◆ make_binary_tree()

template<class ConjOrDisj>
const Def * mim::plug::regex::make_binary_tree ( Defs args)

Definition at line 50 of file normalizers.cpp.

References make_binary_tree().

Referenced by make_binary_tree(), normalize_conj(), and normalize_disj().

◆ make_vector_unique()

void mim::plug::regex::make_vector_unique ( DefVec & args)

Definition at line 94 of file normalizers.cpp.

References compare_re(), and make_vector_unique().

Referenced by make_vector_unique(), merge_ranges(), and normalize_disj().

◆ merge_ranges()

void mim::plug::regex::merge_ranges ( DefVec & args)

◆ normalize_conj()

const Def * mim::plug::regex::normalize_conj ( const Def * type,
const Def * callee,
const Def * arg )

Definition at line 58 of file normalizers.cpp.

References mim::Def::arity(), mim::Lit::isa(), make_binary_tree(), and normalize_conj().

Referenced by normalize_conj().

◆ normalize_disj()

const Def * mim::plug::regex::normalize_disj ( const Def * type,
const Def * ,
const Def * arg )

◆ normalize_not()

const Def * mim::plug::regex::normalize_not ( const Def * ,
const Def * callee,
const Def * arg )

Definition at line 218 of file normalizers.cpp.

References any_unwanted_for_not(), mim::Def::blame(), and normalize_not().

Referenced by normalize_not().

◆ normalize_quant()

template<quant id>
const Def * mim::plug::regex::normalize_quant ( const Def * type,
const Def * callee,
const Def * arg )

Definition at line 23 of file normalizers.cpp.

References mim::Axm::isa(), normalize_quant(), optional, plus, and star.

Referenced by normalize_quant().

◆ normalize_range()

const Def * mim::plug::regex::normalize_range ( const Def * type,
const Def * callee,
const Def * arg )

Definition at line 199 of file normalizers.cpp.

References mim::Lit::isa(), normalize_range(), and mim::Def::projs().

Referenced by normalize_range().

◆ regex2nfa() [1/2]

std::unique_ptr< automaton::NFA > mim::plug::regex::regex2nfa ( const Def * regex)

◆ regex2nfa() [2/2]

std::unique_ptr< automaton::NFA > mim::plug::regex::regex2nfa ( decltype(::regex2nfa) * fptr,
const Def * regex )
inline

Definition at line 15 of file regex2nfa.h.

References regex2nfa().

◆ register_normalizers()

void mim::plug::regex::register_normalizers ( Normalizers & normalizers)

Variable Documentation

◆ Plugin_Id

plugin_t mim::plug::regex::Plugin_Id = 0x4c62066400000000
staticconstexpr

Definition at line 10 of file autogen.h.