[][src]Struct lrpar::RTParserBuilder

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

A run-time parser builder.

Implementations

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

pub fn new(
    grm: &'a YaccGrammar<StorageT>,
    stable: &'a StateTable<StorageT>
) -> Self
[src]

Create a new run-time parser from a YaccGrammar, a StateGraph, and a StateTable.

pub fn recoverer(self, rk: RecoveryKind) -> Self[src]

Set the recoverer for this parser to rk.

pub fn term_costs(self, f: &'a dyn Fn(TIdx<StorageT>) -> u8) -> Self[src]

pub fn parse_generictree(
    &self,
    lexer: &dyn NonStreamingLexer<'_, StorageT>
) -> (Option<Node<StorageT>>, Vec<LexParseError<StorageT>>)
[src]

Parse input, and (if possible) return a generic parse tree. See the arguments for parse_actions for more details about the return value.

pub fn parse_noaction(
    &self,
    lexer: &dyn NonStreamingLexer<'_, StorageT>
) -> Vec<LexParseError<StorageT>>
[src]

Parse input, returning any errors found. See the arguments for parse_actions for more details about the return value.

pub fn parse_actions<'b: 'a, 'input: 'b, ActionT: 'a>(
    &self,
    lexer: &'b dyn NonStreamingLexer<'input, StorageT>,
    actions: &'a [&'a dyn Fn(RIdx<StorageT>, &'b dyn NonStreamingLexer<'input, StorageT>, Span, Drain<'_, AStackType<ActionT, StorageT>>) -> ActionT]
) -> (Option<ActionT>, Vec<LexParseError<StorageT>>)
[src]

Parse input, execute actions, and return the associated value (if possible) and/or any lexing/parsing errors encountered. Note that the two parts of the (value, errors) return pair are entirely independent: one can encounter errors without a value being produced (None, [...]), errors and a value (Some(...), [...]), as well as a value and no errors (Some(...), []). Errors are sorted by the position they were found in the input and can be a mix of lexing and parsing errors.

Auto Trait Implementations

impl<'a, StorageT> !RefUnwindSafe for RTParserBuilder<'a, StorageT>

impl<'a, StorageT> !Send for RTParserBuilder<'a, StorageT>

impl<'a, StorageT> !Sync for RTParserBuilder<'a, StorageT>

impl<'a, StorageT> Unpin for RTParserBuilder<'a, StorageT> where
    StorageT: Unpin

impl<'a, StorageT> !UnwindSafe for RTParserBuilder<'a, StorageT>

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, 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<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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