pub struct Grammar {
pub start: String,
pub rules: HashMap<String, Vec<Rc<Rule>>>,
/* private fields */
}
Fields§
§start: String
§rules: HashMap<String, Vec<Rc<Rule>>>
Implementations§
Source§impl Grammar
impl Grammar
pub fn parse_chart(&self, input: &[&str]) -> Chart
pub fn parse_forest(&self, input: &[&str]) -> Forest
pub fn unify_tree( tree: SynTree<Rc<Rule>, String>, ) -> Result<(SynTree<String, String>, NodeRef), Err>
pub fn parse(&self, input: &[&str]) -> Vec<(SynTree<String, String>, NodeRef)>
pub fn read_from_file<P: AsRef<Path>>(path: P) -> Result<Self, Err>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Grammar
impl !RefUnwindSafe for Grammar
impl !Send for Grammar
impl !Sync for Grammar
impl Unpin for Grammar
impl !UnwindSafe for Grammar
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