pub trait CfgClassifyExt {
// Required methods
fn recursion(&self) -> Recursion<'_>;
fn make_proper(&mut self) -> bool;
fn usefulness(&mut self) -> Usefulness;
fn usefulness_with_roots(&mut self, roots: &[Symbol]) -> Usefulness;
}Expand description
Extension trait for assigning categories to context-free grammar rules, and related operations.
Required Methods§
Sourcefn make_proper(&mut self) -> bool
fn make_proper(&mut self) -> bool
Modifies this grammar in-place to remove useless rules.
Sourcefn usefulness(&mut self) -> Usefulness
fn usefulness(&mut self) -> Usefulness
Determines usefulness of rules with the grammar’s roots.
A rule is useful if it is reachable from the grammar’s roots, and productive.
Sourcefn usefulness_with_roots(&mut self, roots: &[Symbol]) -> Usefulness
fn usefulness_with_roots(&mut self, roots: &[Symbol]) -> Usefulness
Determines usefulness of rules with the given roots.
A rule is useful if it is reachable from these roots, and productive.