pub struct Compiled<I: Clone + Ord> { /* private fields */ }Expand description
Deterministic finite automata.
Implementations§
source§impl<I: Clone + Ord> Graph<I>
impl<I: Clone + Ord> Graph<I>
sourcepub fn accept<Iter: IntoIterator<Item = I>>(&self, iter: Iter) -> bool
pub fn accept<Iter: IntoIterator<Item = I>>(&self, iter: Iter) -> bool
Decide whether an input belongs to the regular langage this NFA accepts.
sourcepub fn reject<Iter: IntoIterator<Item = I>>(&self, iter: Iter) -> bool
pub fn reject<Iter: IntoIterator<Item = I>>(&self, iter: Iter) -> bool
Decide whether an input belongs to the regular langage this NFA accepts.
sourcepub fn generalize(&self) -> Parser<I>
pub fn generalize(&self) -> Parser<I>
Generalize to an identical NFA.
sourcepub fn fuzz(&self) -> Result<Fuzzer<I>, NeverAccepts>
pub fn fuzz(&self) -> Result<Fuzzer<I>, NeverAccepts>
Randomly generate inputs that are all guaranteed to be accepted.
NOTE: returns an infinite iterator! for input in automaton.fuzz()? will loop forever . . .
Errors
If this automaton never accepts any input.
sourcepub fn would_ever_accept(&self) -> bool
pub fn would_ever_accept(&self) -> bool
Check if there exists a string this DFA will accept.
sourcepub fn into_source(self, name: &str) -> Stringwhere
I: Expression,
pub fn into_source(self, name: &str) -> Stringwhere I: Expression,
Print as a set of Rust source-code functions.
sourcepub fn to_ast(&self, name: &str) -> (ItemFn, ItemMod)where
I: Expression,
pub fn to_ast(&self, name: &str) -> (ItemFn, ItemMod)where I: Expression,
Print as a set of Rust source-code functions.
sourcepub fn to_fuzz_ast(&self, name: &str) -> (ItemFn, ItemMod)where
I: Expression,
pub fn to_fuzz_ast(&self, name: &str) -> (ItemFn, ItemMod)where I: Expression,
Print as a set of Rust source-code functions.
Trait Implementations§
source§impl<I: Ord + Clone + Ord> Ord for Graph<I>
impl<I: Ord + Clone + Ord> Ord for Graph<I>
source§impl<I: PartialEq + Clone + Ord> PartialEq for Graph<I>
impl<I: PartialEq + Clone + Ord> PartialEq for Graph<I>
source§impl<I: PartialOrd + Clone + Ord> PartialOrd for Graph<I>
impl<I: PartialOrd + Clone + Ord> PartialOrd for Graph<I>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<I: Eq + Clone + Ord> Eq for Graph<I>
impl<I: Clone + Ord> StructuralEq for Graph<I>
impl<I: Clone + Ord> StructuralPartialEq for Graph<I>
Auto Trait Implementations§
impl<I> RefUnwindSafe for Graph<I>where I: RefUnwindSafe,
impl<I> Send for Graph<I>where I: Send,
impl<I> Sync for Graph<I>where I: Sync,
impl<I> Unpin for Graph<I>
impl<I> UnwindSafe for Graph<I>where I: RefUnwindSafe,
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