Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::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 thorin::plug::regex::compare_re ( const Def lhs,
const Def rhs 
)

Definition at line 85 of file normalizers.cpp.

References compare_re().

Referenced by compare_re(), and make_vector_unique().

◆ equals_any() [1/3]

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

Definition at line 142 of file normalizers.cpp.

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

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

◆ equals_any() [2/3]

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

Definition at line 146 of file normalizers.cpp.

References equals_any().

◆ equals_any() [3/3]

bool thorin::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 thorin::plug::regex::flatten_in_arg ( Ref  arg)

Definition at line 60 of file normalizers.cpp.

◆ flatten_in_arg() [2/2]

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

Definition at line 50 of file normalizers.cpp.

References thorin::Def::projs().

◆ get_range()

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

Definition at line 111 of file normalizers.cpp.

References get_range().

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

◆ is_in_range()

bool thorin::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 thorin::plug::regex::make_binary_tree ( Ref  type,
Defs  args 
)

Definition at line 66 of file normalizers.cpp.

◆ make_vector_unique()

void thorin::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 thorin::plug::regex::merge_ranges ( DefVec args)

Definition at line 121 of file normalizers.cpp.

References get_range(), make_vector_unique(), and automaton::merge_ranges().

◆ normalize_conj()

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

Definition at line 74 of file normalizers.cpp.

References thorin::Def::as_lit_arity(), normalize_conj(), and thorin::Def::world().

Referenced by normalize_conj().

◆ normalize_disj()

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

◆ normalize_not()

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

Definition at line 217 of file normalizers.cpp.

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

Referenced by normalize_not().

◆ normalize_quant()

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

Definition at line 24 of file normalizers.cpp.

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

◆ normalize_range()

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

◆ regex2nfa() [1/2]

std::unique_ptr< automaton::NFA > thorin::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 > thorin::plug::regex::regex2nfa ( Ref  regex)

Definition at line 89 of file regex2nfa.cpp.

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

◆ register_normalizers()

void thorin::plug::regex::register_normalizers ( Normalizers normalizers)

Referenced by thorin_get_plugin().

Variable Documentation

◆ Plugin_Id

constexpr plugin_t thorin::plug::regex::Plugin_Id = 0x4c62066400000000
staticconstexpr

Definition at line 10 of file autogen.h.