Struct ExprSet

pub struct ExprSet { /* private fields */ }

Implementations§

§

impl ExprSet

pub fn new(alphabet_size: usize) -> ExprSet

pub fn has_simply_forced_bytes(&self, e: ExprRef, bytes: &[u8]) -> bool

If this returns true, then the regex will match only strings starting with the given prefix. If this returns false, then it’s possible (but not sure) it will match something else.

pub fn set_pp(&mut self, pp: PrettyPrinter)

pub fn pp(&self) -> &PrettyPrinter

pub fn cost(&self) -> u64

pub fn expr_to_string_max_len(&self, id: ExprRef, max_len: usize) -> String

pub fn expr_to_string(&self, id: ExprRef) -> String

pub fn expr_to_string_with_info(&self, id: ExprRef) -> String

pub fn len(&self) -> usize

pub fn num_bytes(&self) -> usize

pub fn get(&self, id: ExprRef) -> Expr<'_>

pub fn reserve(&mut self, size: usize)

pub fn is_valid(&self, id: ExprRef) -> bool

pub fn lookahead_len(&self, e: ExprRef) -> Option<usize>

pub fn possible_lookahead_len(&self, e: ExprRef) -> usize

pub fn get_flags(&self, id: ExprRef) -> ExprFlags

pub fn get_tag(&self, id: ExprRef) -> ExprTag

pub fn get_args(&self, id: ExprRef) -> &[ExprRef]

pub fn is_nullable(&self, id: ExprRef) -> bool

pub fn is_positive(&self, id: ExprRef) -> bool

pub fn simple_map<V>( &mut self, r: ExprRef, process: impl FnMut(&mut ExprSet, &mut Vec<V>, ExprRef) -> V, ) -> V
where V: Clone,

pub fn map<K, V>( &mut self, r: ExprRef, cache: &mut HashMap<K, V>, concat_nullable_check: bool, mk_key: impl Fn(ExprRef) -> K, process: impl FnMut(&mut ExprSet, &mut Vec<V>, ExprRef) -> V, ) -> V
where K: Eq + PartialEq + Hash, V: Clone,

§

impl ExprSet

pub fn byte_set_from_byte(&self, b: u8) -> Vec<u32>

pub fn mk_byte(&mut self, b: u8) -> ExprRef

pub fn mk_byte_set(&mut self, s: &[u32]) -> ExprRef

pub fn mk_repeat(&mut self, e: ExprRef, min: u32, max: u32) -> ExprRef

pub fn mk_or(&mut self, args: &mut Vec<ExprRef>) -> ExprRef

pub fn mk_prefix_tree(&mut self, branches: Vec<(Vec<u8>, ExprRef)>) -> ExprRef

pub fn mk_byte_set_not(&mut self, x: ExprRef) -> ExprRef

pub fn mk_byte_set_or(&mut self, args: &[ExprRef]) -> ExprRef

pub fn mk_byte_set_neg_or(&mut self, args: &[ExprRef]) -> ExprRef

pub fn mk_byte_set_and(&mut self, aa: ExprRef, bb: ExprRef) -> ExprRef

pub fn mk_byte_set_sub(&mut self, aa: ExprRef, bb: ExprRef) -> ExprRef

pub fn mk_remainder_is( &mut self, divisor: u32, remainder: u32, scale: u32, fractional_part: bool, ) -> ExprRef

pub fn mk_and(&mut self, args: &mut Vec<ExprRef>) -> ExprRef

pub fn iter_concat(&self, root: ExprRef) -> ConcatIter<'_>

pub fn iter_concat_bytes(&self, root: ExprRef) -> ConcatByteIter<'_>

pub fn mk_concat_vec(&mut self, args: &[ExprRef]) -> ExprRef

pub fn mk_concat(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

pub fn mk_byte_concat(&mut self, s: &[u8], tail: ExprRef) -> ExprRef

pub fn mk_byte_literal(&mut self, s: &[u8]) -> ExprRef

pub fn mk_literal(&mut self, s: &str) -> ExprRef

pub fn mk_not(&mut self, e: ExprRef) -> ExprRef

pub fn mk_lookahead(&mut self, e: ExprRef, offset: u32) -> ExprRef

§

impl ExprSet

pub fn parse_expr(&mut self, parser: Parser, rx: &str) -> Result<ExprRef, Error>

Trait Implementations§

§

impl Clone for ExprSet

§

fn clone(&self) -> ExprSet

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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
§

impl<T> AsAny for T
where T: Any,

§

fn as_any(&self) -> &(dyn Any + 'static)

§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

§

fn type_name(&self) -> &'static str

Gets the type name of self
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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast for T
where T: AsAny + ?Sized,

§

fn is<T>(&self) -> bool
where T: AsAny,

Returns true if the boxed type is the same as T. Read more
§

fn downcast_ref<T>(&self) -> Option<&T>
where T: AsAny,

Forward to the method defined on the type Any.
§

fn downcast_mut<T>(&mut self) -> Option<&mut T>
where T: AsAny,

Forward to the method defined on the type Any.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryClone for T
where T: Clone,

§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

§

impl<T> Ungil for T
where T: Send,