[][src]Enum liblet::grammar::GrammarError

pub enum GrammarError {
    WrongNonTerminals,
    WrongTerminals,
    WrongStartSymbol(Symbol),
    SymbolError(SymbolError),
    ProductionError(ProductionError),
    NoStartSymbol(Option<String>),
    MultipleStartSymbols(Production),
}

Variants

WrongNonTerminals

Error returned if any of the given non terminals is an invalid non terminal symbol.

WrongTerminals

Error returned if any of the given terminals is an invalid terminal symbol.

WrongStartSymbol(Symbol)

Error returned if the given start symbol is an invalid non terminal symbol.

SymbolError(SymbolError)

Error returned if an error occurred during symbol creation.

ProductionError(ProductionError)

Error returned if an error occurred during productions creation.

NoStartSymbol(Option<String>)

Error returned if trying to create a grammar without a start symbol.

The optional passed argument is the reason which caused the grammar to not have a start symbol and can be useful for debugging purposes

When trying to create a grammar from string, the start symbol will be taken from the left hand side of the first produciton rule, that is, it should be a 1 long collection of symbols.

MultipleStartSymbols(Production)

Error returned if trying to create a grammar with too many start symbols.

The passed production argument is the production from which a start symbol has been tried to extract.

When trying to create a grammar from string, the start symbol will be taken from the left hand side of the first produciton rule, that is, it should be a 1 long collection of symbols.

Trait Implementations

impl Clone for GrammarError[src]

impl Debug for GrammarError[src]

impl Display for GrammarError[src]

impl Eq for GrammarError[src]

impl Error for GrammarError[src]

impl From<ProductionError> for GrammarError[src]

impl Hash for GrammarError[src]

impl PartialEq<GrammarError> for GrammarError[src]

impl StructuralEq for GrammarError[src]

impl StructuralPartialEq for GrammarError[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.