pub struct Dfa { /* private fields */ }Expand description
Lazily built deterministic automaton over symbol classes.
Implementations§
Source§impl Dfa
impl Dfa
Sourcepub fn new(
store: &mut TermStore,
start: TermId,
alphabet: &'static str,
budget: &mut Budget,
) -> Result<Dfa, ErrorCode>
pub fn new( store: &mut TermStore, start: TermId, alphabet: &'static str, budget: &mut Budget, ) -> Result<Dfa, ErrorCode>
Start an automaton at start. The symbol classes are those of start.
Sourcepub fn num_states(&self) -> usize
pub fn num_states(&self) -> usize
Number of states created so far.
Sourcepub fn num_classes(&self) -> usize
pub fn num_classes(&self) -> usize
Number of symbol classes.
Sourcepub fn class_of(&self, c: u32) -> Option<usize>
pub fn class_of(&self, c: u32) -> Option<usize>
Class index of a symbol, or None when outside the universe.
Sourcepub fn step(
&mut self,
store: &mut TermStore,
s: u32,
class: usize,
budget: &mut Budget,
) -> Result<u32, ErrorCode>
pub fn step( &mut self, store: &mut TermStore, s: u32, class: usize, budget: &mut Budget, ) -> Result<u32, ErrorCode>
Transition from s on class, computed once and cached.
Sourcepub fn matches(
&mut self,
store: &mut TermStore,
input: &[u32],
budget: &mut Budget,
) -> Result<bool, ErrorCode>
pub fn matches( &mut self, store: &mut TermStore, input: &[u32], budget: &mut Budget, ) -> Result<bool, ErrorCode>
Full-match test: does the whole input belong to the language?
Auto Trait Implementations§
impl Forget for Dfa
impl Freeze for Dfa
impl RefUnwindSafe for Dfa
impl Send for Dfa
impl Sync for Dfa
impl Unpin for Dfa
impl UnsafeUnpin for Dfa
impl UnwindSafe for Dfa
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