[−][src]Enum liblet::derivation::DerivationError
Variants
WrongProductionIndex(usize)
Error for when the derivation tries to apply a production whose index is not in the valid ones for the grammar.
Examples
If you have a grammar with 3 productions, then the indexes of those productions will be [0..2]. If you specify 3 or more as production index, you'll get this error.
Error for when the derivation tries to apply a production to the indexed symbol in the current sentential form but the latter doesn't have enough symbols to reach the indexed one.
Examples
If you have a sentential form like this A B C
(which has 3 symbols, so the indexes of those symbols in the sentential
form are 0 for the A
, 1 for the B
and 2 for the C
) and try to apply a production rule to an index >= 3,
then you'll get this error.
ImpossibleStep(Production, Vec<Symbol>, DerivationStep)
Error for when the derivation tries to apply a production on part of the sentential form, but the production can't be applied due to the left hand side not matching the part of the sentential form the production is being applied to.
Examples
If you have a derivation step which target the production A -> B
and the index 0 of the sentential form,
which contains C A B
, the left hand side of the production (A
) doesn't match the sentential form starting from
0 (C
), so the derivation step can't be applied and you'll get this error.
Error for when the derivation tries to apply a leftmost_n or rightmost_n derivation to a sentential form which doesn't have a non terminal symbol, so the derivation step can't be applied, because there's no sentential form index to derive from.
Examples
If you have the derivation step which target the production A -> B
and the current sentential form is a
(it doesn't have any non
terminal symbols), you'll get this error.
Trait Implementations
impl Clone for DerivationError
[src]
fn clone(&self) -> DerivationError
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DerivationError
[src]
impl Display for DerivationError
[src]
impl Eq for DerivationError
[src]
impl Error for DerivationError
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl Hash for DerivationError
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<DerivationError> for DerivationError
[src]
fn eq(&self, other: &DerivationError) -> bool
[src]
fn ne(&self, other: &DerivationError) -> bool
[src]
impl StructuralEq for DerivationError
[src]
impl StructuralPartialEq for DerivationError
[src]
Auto Trait Implementations
impl RefUnwindSafe for DerivationError
impl Send for DerivationError
impl Sync for DerivationError
impl Unpin for DerivationError
impl UnwindSafe for DerivationError
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,