[][src]Struct cfgrammar::yacc::ast::GrammarAST

pub struct GrammarAST {
    pub start: Option<String>,
    pub rules: IndexMap<String, Rule>,
    pub prods: Vec<Production>,
    pub tokens: IndexSet<String>,
    pub precs: HashMap<String, Precedence>,
    pub avoid_insert: Option<HashSet<String>>,
    pub implicit_tokens: Option<HashSet<String>>,
    pub epp: HashMap<String, String>,
    pub programs: Option<String>,
}

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.