[][src]Enum simple_parser::Expression

pub enum Expression<N, T> {
    TokenKind {
        token_kind: T,
    },
    Nonterminal {
        nonterminal: N,
    },
    Alternation {
        expressions: Vec<Expression<N, T>>,
    },
    Concatenation {
        expressions: Vec<Expression<N, T>>,
    },
    Repetition {
        expression: Box<Expression<N, T>>,
        min: Option<u32>,
        max: Option<u32>,
    },
}

Variants

TokenKind

Fields of TokenKind

token_kind: T
Nonterminal

Fields of Nonterminal

nonterminal: N
Alternation

Fields of Alternation

expressions: Vec<Expression<N, T>>
Concatenation

Fields of Concatenation

expressions: Vec<Expression<N, T>>
Repetition

Fields of Repetition

expression: Box<Expression<N, T>>min: Option<u32>max: Option<u32>

Implementations

impl<N, T> Expression<N, T> where
    N: Clone + Ord,
    T: Clone + PartialEq<T>, 
[src]

pub fn parse(
    &self,
    tokens: &[Token<T>],
    productions: &BTreeMap<N, Expression<N, T>>
) -> Result<ParseTree<N, T>, &'static str>
[src]

Trait Implementations

impl<N, T> Clone for Expression<N, T> where
    N: Clone,
    T: Clone
[src]

impl<N, T> Debug for Expression<N, T> where
    N: Debug,
    T: Debug
[src]

impl<N, T> Eq for Expression<N, T> where
    N: Eq,
    T: Eq
[src]

impl<N, T> Ord for Expression<N, T> where
    N: Ord,
    T: Ord
[src]

impl<N, T> PartialEq<Expression<N, T>> for Expression<N, T> where
    N: PartialEq<N>,
    T: PartialEq<T>, 
[src]

impl<N, T> PartialOrd<Expression<N, T>> for Expression<N, T> where
    N: PartialOrd<N>,
    T: PartialOrd<T>, 
[src]

Auto Trait Implementations

impl<N, T> RefUnwindSafe for Expression<N, T> where
    N: RefUnwindSafe,
    T: RefUnwindSafe

impl<N, T> Send for Expression<N, T> where
    N: Send,
    T: Send

impl<N, T> Sync for Expression<N, T> where
    N: Sync,
    T: Sync

impl<N, T> Unpin for Expression<N, T> where
    N: Unpin,
    T: Unpin

impl<N, T> UnwindSafe for Expression<N, T> where
    N: UnwindSafe,
    T: UnwindSafe

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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,