pub struct Grammar {
pub definitions: Vec<Def>,
}
Expand description
Parsed LBNF grammar.
Examples
Parsing a separator macro
let grammar = lbnf::parse(r#"separator Stm ";" ;"#)?;
Parsing a rule
let grammar = lbnf::parse(r#"EAdd. Expr ::= Int ;"#)?;
Fields§
§definitions: Vec<Def>
A sequence of Def
.
Trait Implementations§
source§impl PartialEq<Grammar> for Grammar
impl PartialEq<Grammar> for Grammar
impl StructuralPartialEq for Grammar
Auto Trait Implementations§
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