Trait oni_comb_parser_rs::prelude::ParserRunner

source ·
pub trait ParserRunner<'a> {
    type Input;
    type Output;
    type P<'m, X, Y>: ParserMonad<'m, Input = X, Output = Y>
       where X: 'm;

    // Required methods
    fn parse(
        &self,
        input: &'a [Self::Input],
    ) -> ParseResult<'a, Self::Input, Self::Output>;
    fn run(
        &self,
        param: &ParseState<'a, Self::Input>,
    ) -> ParseResult<'a, Self::Input, Self::Output>;

    // Provided method
    fn parse_as_result(
        &self,
        input: &'a [Self::Input],
    ) -> Result<Self::Output, ParseError<'a, Self::Input>> { ... }
}

Required Associated Types§

source

type Input

source

type Output

source

type P<'m, X, Y>: ParserMonad<'m, Input = X, Output = Y> where X: 'm

Required Methods§

source

fn parse( &self, input: &'a [Self::Input], ) -> ParseResult<'a, Self::Input, Self::Output>

Analyze input value(for ParseResult).
入力を解析する。

source

fn run( &self, param: &ParseState<'a, Self::Input>, ) -> ParseResult<'a, Self::Input, Self::Output>

Analyze input value(for ParseResult).
入力を解析する。

Requires ParseState argument.
引数にParseStateが必要です。

Provided Methods§

source

fn parse_as_result( &self, input: &'a [Self::Input], ) -> Result<Self::Output, ParseError<'a, Self::Input>>

Analyze input value(for Result).
入力を解析する。

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, I, A> ParserRunner<'a> for Parser<'a, I, A>

source§

type Input = I

source§

type Output = A

source§

type P<'m, X, Y> = Parser<'m, X, Y> where X: 'm