pub struct RuleTreeSet<T> { /* private fields */ }Implementations§
Source§impl<T> RuleTreeSet<T>
impl<T> RuleTreeSet<T>
pub fn get_num_nt(&self) -> VarId
pub fn get_tree(&self, var: VarId) -> Option<&GrTree>
Sourcepub fn get_trees_iter(&self) -> impl Iterator<Item = (VarId, &GrTree)>
pub fn get_trees_iter(&self) -> impl Iterator<Item = (VarId, &GrTree)>
Returns all the non-empty trees
Sourcepub fn get_vars(&self) -> impl Iterator<Item = VarId> + '_
pub fn get_vars(&self) -> impl Iterator<Item = VarId> + '_
Returns all the variables corresponding to a non-empty tree
Sourcepub fn get_next_available_var(&self) -> VarId
pub fn get_next_available_var(&self) -> VarId
Returns a variable ID that doesn’t exist yet.
Sourcepub fn get_terminals(&self) -> HashSet<TokenId>
pub fn get_terminals(&self) -> HashSet<TokenId>
Returns a set of all the terminals used in the ruleset.
pub fn set_symbol_table(&mut self, symbol_table: SymbolTable)
pub fn get_symbol_table(&self) -> Option<&SymbolTable>
Sourcepub fn to_str(
&self,
var: VarId,
node: Option<usize>,
emphasis: Option<usize>,
) -> String
pub fn to_str( &self, var: VarId, node: Option<usize>, emphasis: Option<usize>, ) -> String
Builds the string representation of the rule tree set of variable var,
optionally starting at node node. If emphasis contains a node ID, this subpart of the
tree is emphasized in the string.
pub fn get_log_mut(&mut self) -> &mut BufLog
Source§impl RuleTreeSet<General>
impl RuleTreeSet<General>
pub fn new() -> Self
pub fn with_log(log: BufLog) -> Self
Sourcepub fn get_tree_mut(&mut self, var: VarId) -> &mut GrTree
pub fn get_tree_mut(&mut self, var: VarId) -> &mut GrTree
Gets the tree corresponding to var. Creates it if it doesn’t exist yet.
Trait Implementations§
Source§impl BuildFrom<RuleTreeSet<General>> for ProdRuleSet<General>
impl BuildFrom<RuleTreeSet<General>> for ProdRuleSet<General>
Source§fn build_from(rules: RuleTreeSet<General>) -> Self
fn build_from(rules: RuleTreeSet<General>) -> Self
Builds a ProdRuleSet<General> from a RuleTreeSet<General>.
If an error is encountered or was already encountered before, an empty shell object is built with the log detailing the error(s).
Source§impl BuildFrom<RuleTreeSet<General>> for RuleTreeSet<Normalized>
impl BuildFrom<RuleTreeSet<General>> for RuleTreeSet<Normalized>
Source§fn build_from(rules: RuleTreeSet<General>) -> Self
fn build_from(rules: RuleTreeSet<General>) -> Self
Transforms a General ruleset to a Normalized ruleset
If an error is encountered or was already encountered before, an empty shell object is built with the log detailing the error(s).
Source§impl BuildFrom<RuleTreeSet<Normalized>> for ProdRuleSet<General>
impl BuildFrom<RuleTreeSet<Normalized>> for ProdRuleSet<General>
Source§fn build_from(rules: RuleTreeSet<Normalized>) -> Self
fn build_from(rules: RuleTreeSet<Normalized>) -> Self
Builds a ProdRuleSet<General> from a RuleTreeSet<Normalized>.
If an error is encountered or was already encountered before, an empty shell object is built with the log detailing the error(s).
Source§impl<T: Clone> Clone for RuleTreeSet<T>
impl<T: Clone> Clone for RuleTreeSet<T>
Source§fn clone(&self) -> RuleTreeSet<T>
fn clone(&self) -> RuleTreeSet<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for RuleTreeSet<T>
impl<T: Debug> Debug for RuleTreeSet<T>
Source§impl<T> HasBuildErrorSource for RuleTreeSet<T>
impl<T> HasBuildErrorSource for RuleTreeSet<T>
const SOURCE: BuildErrorSource = BuildErrorSource::RuleTreeSet
fn get_build_error_source() -> BuildErrorSource
Auto Trait Implementations§
impl<T> Freeze for RuleTreeSet<T>
impl<T> !RefUnwindSafe for RuleTreeSet<T>
impl<T> Send for RuleTreeSet<T>where
T: Send,
impl<T> !Sync for RuleTreeSet<T>
impl<T> Unpin for RuleTreeSet<T>where
T: Unpin,
impl<T> UnwindSafe for RuleTreeSet<T>where
T: UnwindSafe,
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
Source§impl<S> BuildFrom<S> for S
impl<S> BuildFrom<S> for S
Source§fn build_from(source: S) -> S
fn build_from(source: S) -> S
Source§impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
Source§fn build_into(self) -> T
fn build_into(self) -> T
Calls T::from(self) to convert a [S] into a [T].