pub struct Grammar {
pub points: Vec<GrammarPoint>,
pub by_name: HashMap<String, usize, FxBuildHasher>,
pub string_cache: HashMap<String, u32, FxBuildHasher>,
pub string_cache_inv: Vec<Rc<String>>,
/* private fields */
}Expand description
Produced by bnf_to_grammar.
Next step: tokenize.
Fields§
§points: Vec<GrammarPoint>Arena for all grammar points in the grammar.
by_name: HashMap<String, usize, FxBuildHasher>Lookup table for grammar point IDs (indexes in the arena) by their name.
string_cache: HashMap<String, u32, FxBuildHasher>String interning cache: from string to interned ID.
string_cache_inv: Vec<Rc<String>>Inverse string interning cache. Index = string ID. The given Rc<String> is the canonical object for that interned string.
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