Struct ExprSet
pub struct ExprSet { /* private fields */ }
Implementations§
§impl ExprSet
impl ExprSet
pub fn new(alphabet_size: usize) -> ExprSet
pub fn has_simply_forced_bytes(&self, e: ExprRef, bytes: &[u8]) -> bool
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,
) -> Vwhere
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
§impl ExprSet
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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExprSet
impl RefUnwindSafe for ExprSet
impl Send for ExprSet
impl Sync for ExprSet
impl Unpin for ExprSet
impl UnwindSafe for ExprSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
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,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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