Struct Parser

struct Parser { ... }

A convenience parser for regular expressions.

This parser takes as input a regular expression pattern string (the "concrete syntax") and returns a high-level intermediate representation (the HIR) suitable for most types of analysis. In particular, this parser hides the intermediate state of producing an AST (the "abstract syntax"). The AST is itself far more complex than the HIR, so this parser serves as a convenience for never having to deal with it at all.

If callers have more fine grained use cases that need an AST, then please see the ast::parse module.

A Parser can be configured in more detail via a ParserBuilder.

Implementations

impl Parser

fn new() -> Parser

Create a new parser with a default configuration.

The parser can be run with parse method. The parse method returns a high level intermediate representation of the given regular expression.

To set configuration options on the parser, use ParserBuilder.

fn parse(self: &mut Self, pattern: &str) -> Result<Hir, Error>

Parse the regular expression into a high level intermediate representation.

impl Clone for Parser

fn clone(self: &Self) -> Parser

impl Debug for Parser

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

impl Freeze for Parser

impl RefUnwindSafe for Parser

impl Send for Parser

impl Sync for Parser

impl Unpin for Parser

impl UnsafeUnpin for Parser

impl UnwindSafe for Parser

impl<T> Any for Parser

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Parser

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Parser

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Parser

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Parser

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Parser

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Parser

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Parser

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

impl<T, U> TryInto for Parser

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>