Struct oni_comb_parser_rs::prelude::Parser
source · pub struct Parser<'a, I, A> { /* private fields */ }Implementations§
source§impl<'a, I, A> Parser<'a, I, A>
impl<'a, I, A> Parser<'a, I, A>
pub fn new<F>(parse: F) -> Parser<'a, I, A>where F: Fn(&ParseState<'a, I>) -> ParseResult<'a, I, A> + 'a,
Trait Implementations§
source§impl<'a, I, A, B> Add<Parser<'a, I, B>> for Parser<'a, I, A>where
A: Clone + Debug + 'a,
B: Clone + Debug + 'a,
impl<'a, I, A, B> Add<Parser<'a, I, B>> for Parser<'a, I, A>where A: Clone + Debug + 'a, B: Clone + Debug + 'a,
source§impl<'a, I, A> CacheParser<'a> for Parser<'a, I, A>
impl<'a, I, A> CacheParser<'a> for Parser<'a, I, A>
source§impl<'a, I, A> CollectParser<'a> for Parser<'a, I, A>
impl<'a, I, A> CollectParser<'a> for Parser<'a, I, A>
source§impl<'a, I, A> ConversionParser<'a> for Parser<'a, I, A>
impl<'a, I, A> ConversionParser<'a> for Parser<'a, I, A>
source§impl<'a, I, A> DiscardParser<'a> for Parser<'a, I, A>
impl<'a, I, A> DiscardParser<'a> for Parser<'a, I, A>
source§impl<'a, I, A> LoggingParser<'a> for Parser<'a, I, A>
impl<'a, I, A> LoggingParser<'a> for Parser<'a, I, A>
fn log( self, name: &'a str, log_level: LogLevel ) -> Self::P<'a, Self::Input, Self::Output>where Self::Input: Debug, Self::Output: Debug + 'a,
fn debug(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>where Self::Input: Debug, Self::Output: Debug + 'a,
fn info(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>where Self::Input: Debug, Self::Output: Debug + 'a,
fn warn(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>where Self::Input: Debug, Self::Output: Debug + 'a,
fn error(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>where Self::Input: Debug, Self::Output: Debug + 'a,
fn name(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>where Self::Input: Debug, Self::Output: Debug + 'a,
source§impl<'a, I, A, B> Mul<Parser<'a, I, B>> for Parser<'a, I, A>where
A: Clone + Debug + 'a,
B: Clone + Debug + 'a,
impl<'a, I, A, B> Mul<Parser<'a, I, B>> for Parser<'a, I, A>where A: Clone + Debug + 'a, B: Clone + Debug + 'a,
source§impl<'a, I, A> OffsetParser<'a> for Parser<'a, I, A>
impl<'a, I, A> OffsetParser<'a> for Parser<'a, I, A>
source§impl<'a, I, A> OperatorParser<'a> for Parser<'a, I, A>
impl<'a, I, A> OperatorParser<'a> for Parser<'a, I, A>
fn and_then<B>( self, pb: Self::P<'a, Self::Input, B> ) -> Self::P<'a, Self::Input, (Self::Output, B)>where Self::Output: Clone + Debug + 'a, B: Clone + Debug + 'a,
fn or( self, pb: Self::P<'a, Self::Input, Self::Output> ) -> Self::P<'a, Self::Input, Self::Output>where Self::Output: Debug + 'a,
fn exists(self) -> Self::P<'a, Self::Input, bool>where Self::Output: Debug + 'a,
fn not(self) -> Self::P<'a, Self::Input, ()>where Self::Output: Debug + 'a,
fn opt(self) -> Self::P<'a, Self::Input, Option<Self::Output>>where Self::Output: Clone + Debug + 'a,
fn attempt(self) -> Self::P<'a, Self::Input, Self::Output>where Self::Output: Debug + 'a,
fn scan_right1<BOP>( self, op: Self::P<'a, Self::Input, BOP> ) -> Self::P<'a, Self::Input, Self::Output>where BOP: Fn(Self::Output, Self::Output) -> Self::Output + 'a, Self::Output: Clone + Debug + 'a,
fn chain_right0<BOP>( self, op: Self::P<'a, Self::Input, BOP>, x: Self::Output ) -> Self::P<'a, Self::Input, Self::Output>where BOP: Fn(Self::Output, Self::Output) -> Self::Output + 'a, Self::Output: Clone + Debug + 'a,
fn chain_left0<BOP>( self, op: Self::P<'a, Self::Input, BOP>, x: Self::Output ) -> Self::P<'a, Self::Input, Self::Output>where BOP: Fn(Self::Output, Self::Output) -> Self::Output + 'a, Self::Output: Clone + Debug + 'a,
fn chain_right1<BOP>( self, op: Self::P<'a, Self::Input, BOP> ) -> Self::P<'a, Self::Input, Self::Output>where BOP: Fn(Self::Output, Self::Output) -> Self::Output + 'a, Self::Output: Clone + Debug + 'a,
fn chain_left1<BOP>( self, op: Self::P<'a, Self::Input, BOP> ) -> Self::P<'a, Self::Input, Self::Output>where BOP: Fn(Self::Output, Self::Output) -> Self::Output + 'a, Self::Output: Clone + Debug + 'a,
fn rest_right1<BOP>( self, op: Self::P<'a, Self::Input, BOP>, x: Self::Output ) -> Self::P<'a, Self::Input, Self::Output>where BOP: Fn(Self::Output, Self::Output) -> Self::Output + 'a, Self::Output: Clone + Debug + 'a,
fn rest_left1<BOP>( self, op: Self::P<'a, Self::Input, BOP>, x: Self::Output ) -> Self::P<'a, Self::Input, Self::Output>where BOP: Fn(Self::Output, Self::Output) -> Self::Output + 'a, Self::Output: Clone + Debug + 'a,
source§impl<'a, I, A> ParserFilter<'a> for Parser<'a, I, A>
impl<'a, I, A> ParserFilter<'a> for Parser<'a, I, A>
source§impl<'a, I, A> ParserFunctor<'a> for Parser<'a, I, A>
impl<'a, I, A> ParserFunctor<'a> for Parser<'a, I, A>
source§impl<'a, I, A> ParserMonad<'a> for Parser<'a, I, A>
impl<'a, I, A> ParserMonad<'a> for Parser<'a, I, A>
source§impl<'a, I, A> ParserPure<'a> for Parser<'a, I, A>
impl<'a, I, A> ParserPure<'a> for Parser<'a, I, A>
source§impl<'a, I, A> ParserRunner<'a> for Parser<'a, I, A>
impl<'a, I, A> ParserRunner<'a> for Parser<'a, I, A>
type Input = I
type Output = A
type P<'m, X, Y> where X: 'm = Parser<'m, X, Y>
source§fn parse(
&self,
input: &'a [Self::Input]
) -> ParseResult<'a, Self::Input, Self::Output>
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>
fn run( &self, param: &ParseState<'a, Self::Input> ) -> ParseResult<'a, Self::Input, Self::Output>
source§fn parse_as_result(
&self,
input: &'a [Self::Input]
) -> Result<Self::Output, ParseError<'a, Self::Input>>
fn parse_as_result( &self, input: &'a [Self::Input] ) -> Result<Self::Output, ParseError<'a, Self::Input>>
Analyze input value(for Result).
入力を解析する。
入力を解析する。
source§impl<'a, I, A> PeekParser<'a> for Parser<'a, I, A>
impl<'a, I, A> PeekParser<'a> for Parser<'a, I, A>
source§impl<'a, I, A> RepeatParser<'a> for Parser<'a, I, A>
impl<'a, I, A> RepeatParser<'a> for Parser<'a, I, A>
fn repeat<R>(self, range: R) -> Self::P<'a, Self::Input, Vec<Self::Output>>where R: RangeArgument<usize> + Debug + 'a, Self::Output: Debug + 'a, Self: Sized,
fn of_many0(self) -> Self::P<'a, Self::Input, Vec<Self::Output>>where Self::Output: Debug + 'a,
fn of_many1(self) -> Self::P<'a, Self::Input, Vec<Self::Output>>where Self::Output: Debug + 'a,
fn of_many_n_m( self, n: usize, m: usize ) -> Self::P<'a, Self::Input, Vec<Self::Output>>where Self::Output: Debug + 'a,
fn of_count(self, n: usize) -> Self::P<'a, Self::Input, Vec<Self::Output>>where Self::Output: Debug + 'a,
fn of_rep_sep<B, R>( self, range: R, separator: Option<Self::P<'a, Self::Input, B>> ) -> Self::P<'a, Self::Input, Vec<Self::Output>>where R: RangeArgument<usize> + Debug + 'a, Self::Output: Debug + 'a, B: Debug + 'a,
fn of_many0_sep<B>( self, separator: Self::P<'a, Self::Input, B> ) -> Self::P<'a, Self::Input, Vec<Self::Output>>where Self::Output: Debug + 'a, B: Debug + 'a,
fn of_many1_sep<B>( self, separator: Self::P<'a, Self::Input, B> ) -> Self::P<'a, Self::Input, Vec<Self::Output>>where Self::Output: Debug + 'a, B: Debug + 'a,
fn of_many_n_m_sep<B>( self, n: usize, m: usize, separator: Self::P<'a, Self::Input, B> ) -> Self::P<'a, Self::Input, Vec<Self::Output>>where Self::Output: Debug + 'a, B: Debug + 'a,
fn of_count_sep<B>( self, n: usize, separator: Self::P<'a, Self::Input, B> ) -> Self::P<'a, Self::Input, Vec<Self::Output>>where Self::Output: Debug + 'a, B: Debug + 'a,
source§impl<'a, I, A> SkipParser<'a> for Parser<'a, I, A>
impl<'a, I, A> SkipParser<'a> for Parser<'a, I, A>
fn skip_left<B>( self, pb: Self::P<'a, Self::Input, B> ) -> Self::P<'a, Self::Input, B>where Self::Output: Clone + Debug + 'a, B: Clone + Debug + 'a,
fn skip_right<B>( self, pb: Self::P<'a, Self::Input, B> ) -> Self::P<'a, Self::Input, Self::Output>where Self::Output: Clone + Debug + 'a, B: Clone + Debug + 'a,
fn surround<B, C>( self, left_parser: Self::P<'a, Self::Input, B>, right_parser: Self::P<'a, Self::Input, C> ) -> Self::P<'a, Self::Input, Self::Output>where Self::Output: Clone + Debug + 'a, B: Clone + Debug + 'a, C: Clone + Debug + 'a,
Auto Trait Implementations§
impl<'a, I, A> !RefUnwindSafe for Parser<'a, I, A>
impl<'a, I, A> !Send for Parser<'a, I, A>
impl<'a, I, A> !Sync for Parser<'a, I, A>
impl<'a, I, A> Unpin for Parser<'a, I, A>
impl<'a, I, A> !UnwindSafe for Parser<'a, I, A>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more