pub struct Matcher { /* private fields */ }Implementations§
Source§impl Matcher
impl Matcher
pub fn new( pattern: Pattern, disambiguation: Disambiguation, size_limit: usize, ) -> Self
pub fn new_with_backend( pattern: Pattern, disambiguation: Disambiguation, size_limit: usize, backend: Backend, ) -> Self
pub fn pattern(&self) -> &Pattern
pub const fn disambiguation(&self) -> Disambiguation
pub fn lowering(&self) -> &Lowering
pub fn pool(&self) -> &IrPool
Sourcepub fn parse_value(&mut self, input: &str) -> Result<Value, MatchError>
pub fn parse_value(&mut self, input: &str) -> Result<Value, MatchError>
Parse an entire input and reconstruct its typed IR value.
§Errors
Returns MatchError::NoMatch when the selected backend rejects the input, and
MatchError::SizeLimitExceeded on recognition or value-reconstruction exhaustion.
Sourcepub fn parse(&mut self, input: &str) -> Result<ParseTree, MatchError>
pub fn parse(&mut self, input: &str) -> Result<ParseTree, MatchError>
Parse an entire input and expose the derivation in AST vocabulary.
§Errors
Returns MatchError::NoMatch if the entire input is not in the pattern’s language, and
MatchError::SizeLimitExceeded on resource exhaustion.
Sourcepub fn find_parse(
&mut self,
input: &str,
) -> Result<Option<ParseTree>, MatchError>
pub fn find_parse( &mut self, input: &str, ) -> Result<Option<ParseTree>, MatchError>
Find and parse the leftmost-longest matching substring.
§Errors
Returns MatchError::SizeLimitExceeded if the matching-state limit is exceeded.
Sourcepub fn try_is_match(&mut self, input: &str) -> Result<bool, MatchError>
pub fn try_is_match(&mut self, input: &str) -> Result<bool, MatchError>
Check an entire input without discarding resource-limit failures.
§Errors
Returns MatchError::SizeLimitExceeded if the matching-state limit is exceeded.
pub fn is_match(&mut self, input: &str) -> bool
pub fn trace(&mut self, input: &str) -> Vec<TraceStep>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Matcher
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnsafeUnpin for Matcher
impl UnwindSafe for Matcher
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