Enum gallop::GrammarError
source · [−]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
sourceimpl<'a> Clone for GrammarError<'a>
impl<'a> Clone for GrammarError<'a>
sourcefn clone(&self) -> GrammarError<'a>
fn clone(&self) -> GrammarError<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for GrammarError<'a>
impl<'a> Debug for GrammarError<'a>
sourceimpl<'a> PartialEq<GrammarError<'a>> for GrammarError<'a>
impl<'a> PartialEq<GrammarError<'a>> for GrammarError<'a>
sourcefn eq(&self, other: &GrammarError<'a>) -> bool
fn eq(&self, other: &GrammarError<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GrammarError<'a>) -> bool
fn ne(&self, other: &GrammarError<'a>) -> bool
This method tests for !=
.
impl<'a> StructuralPartialEq for GrammarError<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for GrammarError<'a>
impl<'a> Send for GrammarError<'a>
impl<'a> Sync for GrammarError<'a>
impl<'a> Unpin for GrammarError<'a>
impl<'a> UnwindSafe for GrammarError<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more