[−][src]Struct cfgrammar::yacc::ast::GrammarAST
An AST representing a grammar. This is built up gradually: when it is finished, the
complete_and_validate
must be called exactly once in order to finish the set-up. At that
point, any further mutations made to the struct lead to undefined behaviour.
Fields
start: Option<String>
rules: IndexMap<String, Rule>
prods: Vec<Production>
tokens: IndexSet<String>
precs: HashMap<String, Precedence>
avoid_insert: Option<HashSet<String>>
implicit_tokens: Option<HashSet<String>>
epp: HashMap<String, String>
programs: Option<String>
Methods
impl GrammarAST
[src]
pub fn new() -> GrammarAST
[src]
pub fn add_rule(&mut self, name: String, actiont: Option<String>)
[src]
pub fn add_prod(
&mut self,
rule_name: String,
symbols: Vec<Symbol>,
precedence: Option<String>,
action: Option<String>
)
[src]
&mut self,
rule_name: String,
symbols: Vec<Symbol>,
precedence: Option<String>,
action: Option<String>
)
pub fn add_programs(&mut self, s: String)
[src]
pub fn get_rule(&self, key: &str) -> Option<&Rule>
[src]
pub fn has_token(&self, s: &str) -> bool
[src]
Auto Trait Implementations
impl RefUnwindSafe for GrammarAST
impl Send for GrammarAST
impl Sync for GrammarAST
impl Unpin for GrammarAST
impl UnwindSafe for GrammarAST
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,