[][src]Struct lrpar::parser::Parser

pub struct Parser<'a, StorageT: 'a + Eq + Hash, ActionT: 'a> { /* fields omitted */ }

Methods

impl<'a, StorageT: 'static + Debug + Hash + PrimInt + Unsigned, ActionT: 'static> Parser<'a, StorageT, ActionT> where
    usize: AsPrimitive<StorageT>,
    u32: AsPrimitive<StorageT>, 
[src]

pub fn lr(
    &self,
    laidx: usize,
    pstack: &mut Vec<StIdx>,
    astack: &mut Vec<AStackType<ActionT, StorageT>>,
    errors: &mut Vec<LexParseError<StorageT>>
) -> Option<ActionT>
[src]

Start parsing text at laidx (using the lexeme in lexeme_prefix, if it is not None, as the first lexeme) up to (but excluding) end_laidx (if it's specified). Parsing continues as long as possible (assuming that any errors encountered can be recovered from) unless end_laidx is None, at which point this function returns as soon as it encounters an error.

Note that if lexeme_prefix is specified, laidx will still be incremented, and thus end_laidx must be set to laidx + 1 in order that the parser doesn't skip the real lexeme at position laidx.

Return Some(value) if the parse reached an accept state (i.e. all the input was consumed, possibly after making repairs) or None (i.e. some of the input was not consumed, even after possibly making repairs) otherwise.

pub fn lr_upto(
    &self,
    lexeme_prefix: Option<Lexeme<StorageT>>,
    laidx: usize,
    end_laidx: usize,
    pstack: &mut Vec<StIdx>,
    astack: &mut Option<&mut Vec<AStackType<ActionT, StorageT>>>
) -> usize
[src]

Parse from laidx up to (but excluding) end_laidx mutating pstack as parsing occurs. Returns the index of the token it parsed up to (by definition <= end_laidx: can be less if the input is < end_laidx, or if an error is encountered). Does not do any form of error recovery.

Auto Trait Implementations

impl<'a, StorageT, ActionT> !Send for Parser<'a, StorageT, ActionT>

impl<'a, StorageT, ActionT> !Sync for Parser<'a, StorageT, ActionT>

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err