[−][src]Struct earlgrey::GrammarBuilder
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]
S: Into<String>,
pub fn terminal<S, P>(self, name: S, pred: P) -> Self where
S: Into<String>,
P: 'static + Fn(&str) -> bool,
[src]
S: Into<String>,
P: 'static + Fn(&str) -> bool,
pub fn quiet_nonterm<S>(&mut self, name: S) where
S: Into<String>,
[src]
S: Into<String>,
pub fn quiet_terminal<S, P>(&mut self, name: S, pred: P) where
S: Into<String>,
P: 'static + Fn(&str) -> bool,
[src]
S: Into<String>,
P: 'static + Fn(&str) -> bool,
pub fn rule<S, S2>(self, head: S, spec: &[S2]) -> Self where
S: AsRef<str>,
S2: AsRef<str>,
[src]
S: AsRef<str>,
S2: AsRef<str>,
pub fn quiet_rule<S, S2>(&mut self, head: S, spec: &[S2]) where
S: AsRef<str>,
S2: AsRef<str>,
[src]
S: AsRef<str>,
S2: AsRef<str>,
pub fn into_grammar<S>(self, start: S) -> Result<Grammar, String> where
S: Into<String>,
[src]
S: Into<String>,
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]
fn default() -> GrammarBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for GrammarBuilder
impl !Send for GrammarBuilder
impl !Sync for GrammarBuilder
impl Unpin for GrammarBuilder
impl !UnwindSafe for GrammarBuilder
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>,