Skip to main content

Nfa

Struct Nfa 

Source
pub struct Nfa<I, T = (), E = ()>(/* private fields */);

Implementations§

Source§

impl<I, T, E> Nfa<I, T, E>

Source

pub fn with_start_accept(start_accept: T) -> Self

Source

pub fn get(&self, node: usize) -> Option<&Node<I, T, E>>

Source

pub fn push_accept(&mut self, accept: T) -> usize

Source§

impl<I, T: Default, E> Nfa<I, T, E>

Source

pub fn new() -> Self

Source

pub fn push(&mut self) -> usize

Source§

impl<I: Clone + Ord, T, E: Clone + Ord> Nfa<I, T, E>

Source

pub fn connect( &mut self, from: usize, to: usize, by: Option<Partition<I>>, out: E, ) -> bool

Source§

impl<I: Clone + Ord, T: Accept<Token: Clone + Ord + Hash>, E: Accept<Token: Clone + Ord + Hash>> Nfa<I, T, E>

Source

pub fn compile( &self, ) -> (Dfa<I, Arc<BTreeSet<ClosedAccept<<T as Accept>::Token, <E as Accept>::Token>>>, Arc<BTreeSet<<E as Accept>::Token>>>, Vec<Arc<BTreeSet<usize>>>)

Source§

impl<I: Clone + Ord, T: Accept<Token: Clone + Ord + Hash>> Nfa<I, T>

Source

pub fn compile_moore( &self, ) -> (Dfa<I, Arc<BTreeSet<<T as Accept>::Token>>, ()>, Vec<Arc<BTreeSet<usize>>>)

Source§

impl<I, T: Accept, E: Accept> Nfa<I, T, E>

Source

pub fn dot<'a>( &self, fmt_state: impl Fn(usize) -> Cow<'a, str>, fmt_input: impl Fn(Partition<&I>) -> Cow<'a, str>, fmt_node_tok: impl Fn(&T::Token) -> Option<Cow<'a, str>>, fmt_edge_tok: impl Fn(&E::Token) -> Option<Cow<'a, str>>, ) -> Graph<'a>

Trait Implementations§

Source§

impl<I: Debug, T: Debug, E: Debug> Debug for Nfa<I, T, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<I, T: Default, E> Default for Nfa<I, T, E>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<I: Clone + Ord, T, E: Clone + Ord> From<Dfa<I, T, E>> for Nfa<I, T, E>

Source§

fn from(value: Dfa<I, T, E>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<I, T, E> Freeze for Nfa<I, T, E>
where Vec<Node<I, T, E>>: Freeze,

§

impl<I, T, E> RefUnwindSafe for Nfa<I, T, E>
where Vec<Node<I, T, E>>: RefUnwindSafe,

§

impl<I, T, E> Send for Nfa<I, T, E>
where Vec<Node<I, T, E>>: Send,

§

impl<I, T, E> Sync for Nfa<I, T, E>
where Vec<Node<I, T, E>>: Sync,

§

impl<I, T, E> Unpin for Nfa<I, T, E>
where Vec<Node<I, T, E>>: Unpin,

§

impl<I, T, E> UnsafeUnpin for Nfa<I, T, E>
where Vec<Node<I, T, E>>: UnsafeUnpin,

§

impl<I, T, E> UnwindSafe for Nfa<I, T, E>
where Vec<Node<I, T, E>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.