CfgClassifyExt

Trait CfgClassifyExt 

Source
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§

Source

fn recursion(&self) -> Recursion<'_>

Allows you to access information on rule recursiveness.

Source

fn make_proper(&mut self) -> bool

Modifies this grammar in-place to remove useless rules.

Source

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.

Source

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.

Implementations on Foreign Types§

Source§

impl CfgClassifyExt for Cfg

Source§

fn recursion(&self) -> Recursion<'_>

Source§

fn usefulness(&mut self) -> Usefulness

Source§

fn usefulness_with_roots(&mut self, roots: &[Symbol]) -> Usefulness

Source§

fn make_proper(&mut self) -> bool

Implementors§