Struct TransitionFunctions

Source
pub struct TransitionFunctions {
    state_transitions: HashMap<StateID, FunctionIdx>,
    branch_to_transition: FunctionIdx,
    pub make_current_transitions: FunctionIdx,
}
Expand description

This struct contains a map of functions that are the transitions for each NFA state.

This corresponds to the next function in [PikeVM][regex_automata::nfa::thompson::pikevm::PikeVM].

Fields§

§state_transitions: HashMap<StateID, FunctionIdx>§branch_to_transition: FunctionIdx§make_current_transitions: FunctionIdx

Implementations§

Source§

impl TransitionFunctions

Source

pub fn new( ctx: &mut CompileContext, epsilon_closures: &EpsilonClosureFunctions, transition_layout: &TransitionLayout, ) -> Self

Creates and registers all WebAssembly functions required for handling NFA state transitions.

Source

fn make_current_transitions_fn( branch_to_transition: FunctionIdx, branch_to_transition_is_match_block_sig: TypeIdx, state_id_layout: &Layout, ) -> Function

Source

fn branch_to_transition_fn( state_transitions: &HashMap<StateID, FunctionIdx>, ) -> Function

Source

fn transition_fn( for_sid: StateID, states: &[State], branch_to_epsilon_closure: FunctionIdx, lookup_table: Option<LookupTable>, state_id_layout: &Layout, ) -> Function

Source

fn needs_transition_fn(nfa: &NFA, sid: StateID) -> bool

Return true if the given state needs a transition function.

Source

fn non_terminal_transition_prefix(instructions: &mut InstructionSink<'_>)

Source

fn non_terminal_transition_suffix( instructions: &mut InstructionSink<'_>, branch_to_epsilon_closure: FunctionIdx, )

Source

fn sparse_transition_body( instructions: &mut InstructionSink<'_>, sparse_table: SparseTable, labels_name_map: &mut NameMap, state_id_layout: &Layout, )

Source

fn dense_transition_body( instructions: &mut InstructionSink<'_>, table: DenseTable, state_id_layout: &Layout, )

Source

fn byte_range_transition_body( instructions: &mut InstructionSink<'_>, trans: &Transition, )

Trait Implementations§

Source§

impl Debug for TransitionFunctions

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.