Struct regex::pikevm::Fsm [−][src]
pub struct Fsm<'r, I> { prog: &'r Program, stack: &'r mut Vec<FollowEpsilon>, input: I, }
An NFA simulation matching engine.
Fields
prog: &'r Program
The sequence of opcodes (among other things) that is actually executed.
The program may be byte oriented or Unicode codepoint oriented.
stack: &'r mut Vec<FollowEpsilon>
An explicit stack used for following epsilon transitions. (This is borrowed from the cache.)
input: I
The input to search.
Methods
impl<'r, I: Input> Fsm<'r, I>
[src]
impl<'r, I: Input> Fsm<'r, I>
pub fn exec(
prog: &'r Program,
cache: &RefCell<ProgramCacheInner>,
matches: &mut [bool],
slots: &mut [Option<usize>],
quit_after_match: bool,
input: I,
start: usize
) -> bool
[src]
pub fn exec(
prog: &'r Program,
cache: &RefCell<ProgramCacheInner>,
matches: &mut [bool],
slots: &mut [Option<usize>],
quit_after_match: bool,
input: I,
start: usize
) -> bool
Execute the NFA matching engine.
If there's a match, exec
returns true
and populates the given
captures accordingly.
fn exec_(
&mut self,
clist: &mut Threads,
nlist: &mut Threads,
matches: &mut [bool],
slots: &mut [Option<usize>],
quit_after_match: bool,
at: InputAt
) -> bool
[src]
fn exec_(
&mut self,
clist: &mut Threads,
nlist: &mut Threads,
matches: &mut [bool],
slots: &mut [Option<usize>],
quit_after_match: bool,
at: InputAt
) -> bool
fn step(
&mut self,
nlist: &mut Threads,
matches: &mut [bool],
slots: &mut [Option<usize>],
thread_caps: &mut [Option<usize>],
ip: usize,
at: InputAt,
at_next: InputAt
) -> bool
[src]
fn step(
&mut self,
nlist: &mut Threads,
matches: &mut [bool],
slots: &mut [Option<usize>],
thread_caps: &mut [Option<usize>],
ip: usize,
at: InputAt,
at_next: InputAt
) -> bool
Step through the input, one token (byte or codepoint) at a time.
nlist is the set of states that will be processed on the next token in the input.
caps is the set of captures passed by the caller of the NFA. They are written to only when a match state is visited.
thread_caps is the set of captures set for the current NFA state, ip.
at and at_next are the current and next positions in the input. at or at_next may be EOF.
fn add(
&mut self,
nlist: &mut Threads,
thread_caps: &mut [Option<usize>],
ip: usize,
at: InputAt
)
[src]
fn add(
&mut self,
nlist: &mut Threads,
thread_caps: &mut [Option<usize>],
ip: usize,
at: InputAt
)
Follows epsilon transitions and adds them for processing to nlist, starting at and including ip.
fn add_step(
&mut self,
nlist: &mut Threads,
thread_caps: &mut [Option<usize>],
ip: usize,
at: InputAt
)
[src]
fn add_step(
&mut self,
nlist: &mut Threads,
thread_caps: &mut [Option<usize>],
ip: usize,
at: InputAt
)
A helper function for add that avoids excessive pushing to the stack.