pub enum Mir<S, T> {
Empty,
Ranges(Vec<(S, S)>),
Concat(Vec<Self>),
Alter(Vec<(Self, Option<T>)>),
Kleene(Box<Self>),
}Expand description
Mid-level intermediate representation of regular expressions
with symbol type S and tag type T.
Variants§
Empty
The empty regular expression.
Ranges(Vec<(S, S)>)
Ranges of symbols, the ranges list can not be empty.
All ranges are closed. That is, the start and end of the range are included in the range.
Concat(Vec<Self>)
A concatenation of expressions.
Alter(Vec<(Self, Option<T>)>)
An alternation of expressions and their tags.
An alternation matches only if at least one of its sub-expressions match. If multiple sub-expressions match, then the leftmost is preferred.
Kleene(Box<Self>)
A kleene closure of an expression.
Implementations§
Trait Implementations§
Source§impl<T> MirBuilder for Mir<char, T>
impl<T> MirBuilder for Mir<char, T>
Source§impl<T> MirBuilder for Mir<u8, T>
impl<T> MirBuilder for Mir<u8, T>
impl<S: Eq, T: Eq> Eq for Mir<S, T>
impl<S, T> StructuralPartialEq for Mir<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for Mir<S, T>
impl<S, T> RefUnwindSafe for Mir<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for Mir<S, T>
impl<S, T> Sync for Mir<S, T>
impl<S, T> Unpin for Mir<S, T>
impl<S, T> UnwindSafe for Mir<S, T>where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more