[−][src]Struct lrpar::RTParserBuilder
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]
usize: AsPrimitive<StorageT>,
u32: AsPrimitive<StorageT>,
pub fn new(
grm: &'a YaccGrammar<StorageT>,
stable: &'a StateTable<StorageT>
) -> Self
[src]
grm: &'a YaccGrammar<StorageT>,
stable: &'a StateTable<StorageT>
) -> Self
Create a new run-time parser from a YaccGrammar
, a StateGraph
, and a StateTable
.
pub fn recoverer(mut self: Self, rk: RecoveryKind) -> Self
[src]
Set the recoverer for this parser to rk
.
pub fn term_costs(mut self: 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]
&self,
lexer: &dyn NonStreamingLexer<'_, StorageT>
) -> (Option<Node<StorageT>>, Vec<LexParseError<StorageT>>)
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]
&self,
lexer: &dyn NonStreamingLexer<'_, StorageT>
) -> Vec<LexParseError<StorageT>>
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]
&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>>)
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>
[src]
impl<'a, StorageT> !Send for RTParserBuilder<'a, StorageT>
[src]
impl<'a, StorageT> !Sync for RTParserBuilder<'a, StorageT>
[src]
impl<'a, StorageT> Unpin for RTParserBuilder<'a, StorageT> where
StorageT: Unpin,
[src]
StorageT: Unpin,
impl<'a, StorageT> !UnwindSafe for RTParserBuilder<'a, StorageT>
[src]
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,
pub 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, 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,