[][src]Struct earlgrey::GrammarBuilder

pub struct GrammarBuilder { /* fields omitted */ }

Builds a Gramar while validating existence of Symbols and checking rules.

Methods

impl GrammarBuilder[src]

pub fn nonterm<S>(self, name: S) -> Self where
    S: Into<String>, 
[src]

pub fn terminal<S, P>(self, name: S, pred: P) -> Self where
    S: Into<String>,
    P: 'static + Fn(&str) -> bool
[src]

pub fn quiet_nonterm<S>(&mut self, name: S) where
    S: Into<String>, 
[src]

pub fn quiet_terminal<S, P>(&mut self, name: S, pred: P) where
    S: Into<String>,
    P: 'static + Fn(&str) -> bool
[src]

pub fn rule<S, S2>(self, head: S, spec: &[S2]) -> Self where
    S: AsRef<str>,
    S2: AsRef<str>, 
[src]

pub fn quiet_rule<S, S2>(&mut self, head: S, spec: &[S2]) where
    S: AsRef<str>,
    S2: AsRef<str>, 
[src]

pub fn into_grammar<S>(self, start: S) -> Result<Grammar, String> where
    S: Into<String>, 
[src]

Consume builder into Grammar

pub fn unique_symbol_name(&self) -> String[src]

Generate unique name for a Symbol (used to build grammar mechanically)

Trait Implementations

impl Default for GrammarBuilder[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.