[][src]Struct automata::regex::Regex

pub struct Regex<A: Alphabet> { /* fields omitted */ }

Represents regular expressions over some finite alphabet.

Optimizes storage and construction for reoccurring subexpressions to allow polynomial time conversion from NFA. You can create (and keep) handles on subexpressions, then evaluate as if those subexpressions were at the root. This relationship forms an acyclic graph.

Methods

impl<A: Alphabet> Regex<A>[src]

pub fn new() -> Self[src]

pub fn push(&mut self, op: Op<A>) -> Handle[src]

Push a new operation as the regex root.

It is not required that all regex states are reachable afterwards but all handles must point to existing operations. Returns a handle on the newly inserted operation.

pub fn root(&self) -> Option<Handle>[src]

Get a root to the regex.

pub fn cached(self) -> Cached<A>[src]

Modify the regex with a cache for same terms.

By using a cache for terms, it is possible to lower the memory requirements of the resulting regex through resued subexpressions.

pub fn to_string(&self) -> String[src]

Get a string representation of this regex.

Trait Implementations

impl<A: Alphabet> Default for Regex<A>[src]

Auto Trait Implementations

impl<A> Send for Regex<A> where
    A: Send

impl<A> Sync for Regex<A> where
    A: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.