[][src]Struct liblet::derivation::DerivationStep

pub struct DerivationStep {
    pub p_index: usize,
    pub index: usize,
}

A useful abstraction over derivation steps.

It contains two information:

  • p_index, the production index, needed to retrieve the correct production from the grammar
  • index, the index of the first symbol of the sentential form from which apply the derivation step

Examples

If you have a grammar based on the productions:

  • A -> B C
  • B -> b

you can create a derivation on that grammar, based on the default sentential form which is A (it matches the grammar start symbol initially), then apply a derivation step based on:

  • p_index = 0, so the 0° (first) production rule of the grammar will be used (A -> B C)
  • index = 0, so the 0° (first) symbol of the current sentential form (A) which is A

Fields

p_index: usizeindex: usize

Trait Implementations

impl Clone for DerivationStep[src]

impl Copy for DerivationStep[src]

impl Debug for DerivationStep[src]

impl<'de> Deserialize<'de> for DerivationStep[src]

impl Display for DerivationStep[src]

impl Eq for DerivationStep[src]

impl Hash for DerivationStep[src]

impl Ord for DerivationStep[src]

impl PartialEq<DerivationStep> for DerivationStep[src]

impl PartialOrd<DerivationStep> for DerivationStep[src]

impl Serialize for DerivationStep[src]

impl StructuralEq for DerivationStep[src]

impl StructuralPartialEq for DerivationStep[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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.