pub struct EpsilonClosureFunctions {
state_closures: HashMap<StateID, FunctionIdx>,
pub branch_to_epsilon_closure: FunctionIdx,
}
Expand description
This struct contains a map of functions that are the pre-computed epsilon closure for each NFA state.
Fields§
§state_closures: HashMap<StateID, FunctionIdx>
§branch_to_epsilon_closure: FunctionIdx
Implementations§
Source§impl EpsilonClosureFunctions
impl EpsilonClosureFunctions
Sourcepub fn new(
ctx: &mut CompileContext,
sparse_set_insert: FunctionIdx,
look_funcs: &LookFunctions,
) -> Result<Self, BuildError>
pub fn new( ctx: &mut CompileContext, sparse_set_insert: FunctionIdx, look_funcs: &LookFunctions, ) -> Result<Self, BuildError>
Create a new set of epsilon closure functions for the given input.
fn all_epsilon_closure_fns( ctx: &mut CompileContext, sparse_set_insert: FunctionIdx, look_funcs: &LookFunctions, ) -> Result<HashMap<StateID, FunctionIdx>, BuildError>
Sourcepub fn get(&self, sid: StateID) -> Option<FunctionIdx>
pub fn get(&self, sid: StateID) -> Option<FunctionIdx>
Get the epsilon closure function for the given state ID, if present.
fn branch_to_epsilon_closure_fn( epsilon_closures: &HashMap<StateID, FunctionIdx>, sparse_set_insert: FunctionIdx, ) -> Function
Sourcefn can_omit_epsilon_closure(closure: &EpsilonClosure, for_sid: StateID) -> bool
fn can_omit_epsilon_closure(closure: &EpsilonClosure, for_sid: StateID) -> bool
Return true if we can omit the epsilon closure function for the given state and closure.
We can omit epsilon closures which only contain the self-state, since branch_to_epsilon_closure will always include a default branch to populate the singleton set.
fn epsilon_closure_fn_sig(for_sid: StateID) -> FunctionSignature
fn epsilon_closure_fn_def( closure: EpsilonClosure, state_to_epsilon_closure_fn: &HashMap<StateID, FunctionIdx>, sparse_set_insert: FunctionIdx, look_funcs: &LookFunctions, ) -> Result<FunctionDefinition, BuildError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EpsilonClosureFunctions
impl RefUnwindSafe for EpsilonClosureFunctions
impl Send for EpsilonClosureFunctions
impl Sync for EpsilonClosureFunctions
impl Unpin for EpsilonClosureFunctions
impl UnwindSafe for EpsilonClosureFunctions
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