pub struct SymbolBitSet { /* private fields */ }Expand description
A set of symbols in the form of a bit vector.
Implementations§
Source§impl SymbolBitSet
impl SymbolBitSet
Sourcepub fn new() -> SymbolBitSet
pub fn new() -> SymbolBitSet
Constructs an empty SymbolBitSet.
Sourcepub fn from_elem(grammar: &Cfg, elem: bool) -> SymbolBitSet
pub fn from_elem(grammar: &Cfg, elem: bool) -> SymbolBitSet
Constructs a SymbolBitSet.
Sourcepub fn reset(&mut self, symbol_source: &SymbolSource)
pub fn reset(&mut self, symbol_source: &SymbolSource)
Resets the set to false repeated as many times as there are symbols
in the given source.
In other words, none of the symbols are included, but we have space to mark them as included.
Sourcepub fn set_all(&mut self, symbol_source: &SymbolSource)
pub fn set_all(&mut self, symbol_source: &SymbolSource)
Resets the set to true repeated as many times as there are symbols
in the given source.
In other words, all of the symbols are included in the set.
Sourcepub fn used(&mut self, grammar: &Cfg)
pub fn used(&mut self, grammar: &Cfg)
Makes this set include only symbols which appear anywhere in the grammar.
Sourcepub fn unused(&mut self, grammar: &Cfg)
pub fn unused(&mut self, grammar: &Cfg)
Makes this set include only symbols which do not appear anywhere in the grammar.
Sourcepub fn negate(&mut self)
pub fn negate(&mut self)
Included symbols will be excluded, and symbols that do not appear in the set will be included instead.
Sourcepub fn terminal(&mut self, grammar: &Cfg)
pub fn terminal(&mut self, grammar: &Cfg)
Gathers information about whether symbols are terminal or nonterminal. Constructs a set of terminal symbols.
Constructs a data structure in O(n) time.
Sourcepub fn nulling(&mut self, grammar: &Cfg)
pub fn nulling(&mut self, grammar: &Cfg)
Gathers information about whether symbols are nulling. Includes the set of nulling symbols.
Constructs a data structure in O(n) time.
Sourcepub fn productive(&mut self, grammar: &Cfg)
pub fn productive(&mut self, grammar: &Cfg)
Gathers information about whether symbols are terminal or nonterminal. Includes the set of nonterminal symbols.
Constructs a data structure in O(n) time.
Sourcepub fn subtract_productive(&mut self, grammar: &Cfg)
pub fn subtract_productive(&mut self, grammar: &Cfg)
Excludes all nonterminals from the given grammar from the set.
Sourcepub fn into_bit_vec(self) -> BitVec
pub fn into_bit_vec(self) -> BitVec
Converts into a bit vector.
Sourcepub fn union(&mut self, other: &SymbolBitSet)
pub fn union(&mut self, other: &SymbolBitSet)
Includes all symbols that are included in the other set.
Trait Implementations§
Source§impl Clone for SymbolBitSet
impl Clone for SymbolBitSet
Source§fn clone(&self) -> SymbolBitSet
fn clone(&self) -> SymbolBitSet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more