pub enum GrammarError<'a> {
    EmptyGrammar,
    NoStartSymbol,
    ReservedNonTerminal(NonTerminal<'a>),
    UndefinedNonTerminal(NonTerminal<'a>),
    InvalidGrammar {
        non_terminal: NonTerminal<'a>,
        rule: Rule<'a>,
        rule_element: RuleElement<'a>,
    },
    Conflict {
        non_terminal: NonTerminal<'a>,
        rule: Rule<'a>,
        rule_element: RuleElement<'a>,
    },
}
Expand description

Possible errors that could happen when creating a Parser

Variants

EmptyGrammar

The Grammar has no rules defined yet

NoStartSymbol

The START Rule is not defined yet (see “Reserved Non-terminals” section)

ReservedNonTerminal(NonTerminal<'a>)

The specified NonTerminal is actually reserved (see “Reserved Non-terminals” section)

UndefinedNonTerminal(NonTerminal<'a>)

The specified NonTerminal is used within a Rule but is not defined yet

InvalidGrammar

Fields

non_terminal: NonTerminal<'a>

The offending NonTerminal

rule: Rule<'a>

The offending Rule

rule_element: RuleElement<'a>

The offending RuleElement

The Grammar is invalid, as specified by:

Conflict

Fields

non_terminal: NonTerminal<'a>

The offending NonTerminal

rule: Rule<'a>

The offending Rule

rule_element: RuleElement<'a>

The offending RuleElement

The Grammar has a conflict, as specified by:

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.