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

The regex Plugin More...

Classes

struct  app_range
 
class  LowerRegex
 

Enumerations

%regex.lit
enum  lit : flags_t
 
%regex.cls
enum  cls : flags_t {
  d = 0x4c62066400000500 ,
  D = 0x4c62066400000501 ,
  w = 0x4c62066400000502 ,
  W = 0x4c62066400000503 ,
  s = 0x4c62066400000504 ,
  S = 0x4c62066400000505
}
 
%regex.any
enum  any : flags_t
 
%regex.lower_regex
enum  lower_regex : flags_t
 

Functions

std::unique_ptr< automaton::NFAregex2nfa (Ref regex)
 
std::unique_ptr< automaton::NFAregex2nfa (decltype(::regex2nfa) *fptr, Ref regex)
 
template<class ConjOrDisj >
void flatten_in_arg (Ref arg, DefVec &new_args)
 
template<class ConjOrDisj >
DefVec flatten_in_arg (Ref arg)
 
template<class ConjOrDisj >
Ref make_binary_tree (Ref type, Defs args)
 
bool compare_re (const Def *lhs, const Def *rhs)
 
void make_vector_unique (DefVec &args)
 
bool is_in_range (Range range, nat_t needle)
 
auto get_range (const Def *rng) -> Range
 
void merge_ranges (DefVec &args)
 
template<cls A, cls B>
bool equals_any (const Def *cls0, const Def *cls1)
 
bool equals_any (const Def *lhs, const Def *rhs)
 
bool equals_any (Defs lhs, Defs rhs)
 
void register_normalizers (Normalizers &normalizers)
 

Variables

static constexpr plugin_t Plugin_Id = 0x4c62066400000000
 

%regex.conj

enum  conj : flags_t
 
Ref normalize_conj (Ref type, Ref callee, Ref arg)
 

%regex.disj

enum  disj : flags_t
 
Ref normalize_disj (Ref type, Ref, Ref arg)
 

%regex.range

enum  range : flags_t
 
Ref normalize_range (Ref type, Ref callee, Ref arg)
 

%regex.not_

enum  not_ : flags_t
 
Ref normalize_not (Ref type, Ref callee, Ref arg)
 

%regex.quant

enum  quant : flags_t {
  optional = 0x4c62066400000700 ,
  star = 0x4c62066400000701 ,
  plus = 0x4c62066400000702
}
 
template<quant id>
Ref normalize_quant (Ref type, Ref callee, Ref arg)
 

Detailed Description

Enumeration Type Documentation

◆ any

Definition at line 92 of file autogen.h.

◆ cls

Enumerator

Definition at line 74 of file autogen.h.

◆ conj

Definition at line 15 of file autogen.h.

◆ disj

Definition at line 27 of file autogen.h.

◆ lit

Definition at line 51 of file autogen.h.

◆ lower_regex

Definition at line 121 of file autogen.h.

◆ not_

Definition at line 62 of file autogen.h.

◆ quant

Enumerator
optional 
star 
plus 

Definition at line 103 of file autogen.h.

◆ range

Definition at line 39 of file autogen.h.

Function Documentation

◆ compare_re()

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

Definition at line 85 of file normalizers.cpp.

References compare_re(), and mim::match().

Referenced by compare_re(), and make_vector_unique().

◆ equals_any() [1/3]

template<cls A, cls B>
bool mim::plug::regex::equals_any ( const Def * cls0,
const Def * cls1 )

Definition at line 142 of file normalizers.cpp.

References equals_any(), and mim::match().

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

◆ equals_any() [2/3]

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

Definition at line 146 of file normalizers.cpp.

References equals_any(), and mim::match().

◆ equals_any() [3/3]

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

Definition at line 158 of file normalizers.cpp.

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

◆ flatten_in_arg() [1/2]

template<class ConjOrDisj >
DefVec mim::plug::regex::flatten_in_arg ( Ref arg)

Definition at line 60 of file normalizers.cpp.

References flatten_in_arg().

◆ flatten_in_arg() [2/2]

template<class ConjOrDisj >
void mim::plug::regex::flatten_in_arg ( Ref arg,
DefVec & new_args )

Definition at line 50 of file normalizers.cpp.

References flatten_in_arg(), mim::match(), and mim::Def::projs().

Referenced by flatten_in_arg(), and flatten_in_arg().

◆ get_range()

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

Definition at line 111 of file normalizers.cpp.

References get_range(), and mim::match().

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

◆ is_in_range()

bool mim::plug::regex::is_in_range ( Range range,
nat_t needle )

Definition at line 109 of file normalizers.cpp.

References is_in_range().

Referenced by is_in_range().

◆ make_binary_tree()

template<class ConjOrDisj >
Ref mim::plug::regex::make_binary_tree ( Ref type,
Defs args )

Definition at line 66 of file normalizers.cpp.

◆ make_vector_unique()

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

Definition at line 101 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()

Ref mim::plug::regex::normalize_conj ( Ref type,
Ref callee,
Ref arg )

◆ normalize_disj()

Ref mim::plug::regex::normalize_disj ( Ref type,
Ref ,
Ref arg )

◆ normalize_not()

Ref mim::plug::regex::normalize_not ( Ref type,
Ref callee,
Ref arg )

Definition at line 216 of file normalizers.cpp.

References normalize_not(), mim::World::raw_app(), and mim::Def::world().

Referenced by normalize_not().

◆ normalize_quant()

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

Definition at line 24 of file normalizers.cpp.

References mim::match(), optional, plus, star, and mim::Def::world().

◆ normalize_range()

Ref mim::plug::regex::normalize_range ( Ref type,
Ref callee,
Ref arg )

Definition at line 206 of file normalizers.cpp.

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

Referenced by normalize_range().

◆ regex2nfa() [1/2]

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

Definition at line 15 of file regex2nfa.h.

◆ regex2nfa() [2/2]

std::unique_ptr< automaton::NFA > mim::plug::regex::regex2nfa ( Ref regex)

Definition at line 89 of file regex2nfa.cpp.

Referenced by regex2nfa(), and mim::plug::regex::LowerRegex::rewrite().

◆ register_normalizers()

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

Referenced by mim_get_plugin().

Variable Documentation

◆ Plugin_Id

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

Definition at line 10 of file autogen.h.