Struct cfg::symbol::set::SymbolBitSet

source ·
pub struct SymbolBitSet { /* private fields */ }
Expand description

A set of symbols in the form of a bit vector.

Implementations§

source§

impl SymbolBitSet

source

pub fn new<'a, G>(grammar: &'a G, elem: bool) -> Selfwhere G: RuleContainer + Default, &'a G: RuleContainerRef<'a, Target = G>,

Constructs a SymbolBitSet.

source

pub fn terminal_set<'a, G>(grammar: &'a G) -> Selfwhere G: RuleContainer + Default, &'a G: RuleContainerRef<'a, Target = G>,

Gathers information about whether symbols are terminal or nonterminal. Constructs a set of terminal symbols.

Constructs a data structure in O(n) time.

source

pub fn terminal_or_nulling_set<'a, G>(grammar: &'a G) -> Selfwhere G: RuleContainer + Default, &'a G: RuleContainerRef<'a, Target = G>,

Gathers information about whether symbols are terminal or nonterminal. Constructs a set of terminal symbols.

Constructs a data structure in O(n) time.

source

pub fn set(&mut self, sym: Symbol, value: bool)

Set the entry for a symbol.

source

pub fn has_sym(&self, sym: Symbol) -> bool

Checks whether a given symbol is in this set.

source

pub fn into_bit_vec(self) -> BitVec

Converts into a bit vector.

source

pub fn iter(&self) -> Iter<'_>

Iterates over symbols in the set.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.