pub struct Cfg { /* private fields */ }
Expand description
Basic representation of context-free grammars.
Implementations§
source§impl Cfg
impl Cfg
sourcepub fn with_sym_source(sym_source: SymbolSource) -> Cfg
pub fn with_sym_source(sym_source: SymbolSource) -> Cfg
Creates an empty context-free grammar with the given symbol source.
Trait Implementations§
source§impl RuleContainer for Cfg
impl RuleContainer for Cfg
fn rules<'a>(&'a self) -> impl Iterator<Item = RuleRef<'a>>where
Cfg: 'a,
fn history_graph(&self) -> &HistoryGraph
source§fn sym_source(&self) -> &SymbolSource
fn sym_source(&self) -> &SymbolSource
Returns an immutable reference to the grammar’s symbol source.
source§fn sym_source_mut(&mut self) -> &mut SymbolSource
fn sym_source_mut(&mut self) -> &mut SymbolSource
Returns a mutable reference to the grammar’s symbol source.
source§fn add_rule(&mut self, rule_ref: RuleRef<'_>)
fn add_rule(&mut self, rule_ref: RuleRef<'_>)
Inserts a rule with
lhs
and rhs
on its LHS and RHS. The rule carries history
.fn add_history_node(&mut self, node: HistoryNode) -> NonZero<usize>
source§fn precedenced_rule(&mut self, lhs: Symbol) -> PrecedencedRuleBuilder<&mut Self>
fn precedenced_rule(&mut self, lhs: Symbol) -> PrecedencedRuleBuilder<&mut Self>
Starts building a new precedenced rule.
Auto Trait Implementations§
impl Freeze for Cfg
impl RefUnwindSafe for Cfg
impl Send for Cfg
impl Sync for Cfg
impl Unpin for Cfg
impl UnwindSafe for Cfg
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)