oni_comb_parser_rs::prelude

Struct Parser

Source
pub struct Parser<'a, I, A> { /* private fields */ }

Implementations§

Source§

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

Source

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,

Source§

type Output = Parser<'a, I, (A, B)>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Parser<'a, I, B>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, I, A> BitOr for Parser<'a, I, A>
where A: Debug + 'a,

Source§

type Output = Parser<'a, I, A>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Parser<'a, I, A>) -> Self::Output

Performs the | operation. Read more
Source§

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

Source§

fn cache(self) -> Self::P<'a, Self::Input, Self::Output>
where Self::Input: Clone + 'a, Self::Output: Clone + Debug + 'a,

Source§

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

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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

Source§

fn collect(self) -> Self::P<'a, Self::Input, &'a [Self::Input]>
where Self::Output: Debug + 'a,

Source§

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

Source§

fn map_res<B, E, F>(self, f: F) -> Self::P<'a, Self::Input, B>
where F: Fn(Self::Output) -> Result<B, E> + 'a, E: Debug, Self::Output: Debug + 'a, B: Debug + 'a,

Source§

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

Source§

fn discard(self) -> Self::P<'a, Self::Input, ()>
where Self::Output: Debug + 'a,

Source§

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

Source§

fn log( self, name: &'a str, log_level: LogLevel, ) -> Self::P<'a, Self::Input, Self::Output>
where Self::Input: Debug, Self::Output: Debug + 'a,

Source§

fn debug(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
where Self::Input: Debug, Self::Output: Debug + 'a,

Source§

fn info(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
where Self::Input: Debug, Self::Output: Debug + 'a,

Source§

fn warn(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
where Self::Input: Debug, Self::Output: Debug + 'a,

Source§

fn error(self, name: &'a str) -> Self::P<'a, Self::Input, Self::Output>
where Self::Input: Debug, Self::Output: Debug + 'a,

Source§

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,

Source§

type Output = Parser<'a, I, B>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Parser<'a, I, B>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, I, A> Not for Parser<'a, I, A>
where A: Debug + 'a,

Source§

type Output = Parser<'a, I, ()>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

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

Source§

fn last_offset(self) -> Self::P<'a, Self::Input, usize>
where Self::Output: Debug + 'a,

Source§

fn next_offset(self) -> Self::P<'a, Self::Input, usize>
where Self::Output: Debug + 'a,

Source§

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

Source§

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,

Source§

fn or( self, pb: Self::P<'a, Self::Input, Self::Output>, ) -> Self::P<'a, Self::Input, Self::Output>
where Self::Output: Debug + 'a,

Source§

fn exists(self) -> Self::P<'a, Self::Input, bool>
where Self::Output: Debug + 'a,

Source§

fn not(self) -> Self::P<'a, Self::Input, ()>
where Self::Output: Debug + 'a,

Source§

fn opt(self) -> Self::P<'a, Self::Input, Option<Self::Output>>
where Self::Output: Clone + Debug + 'a,

Source§

fn attempt(self) -> Self::P<'a, Self::Input, Self::Output>
where Self::Output: Debug + 'a,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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>

Source§

fn with_filter<F>(self, f: F) -> Self::P<'a, Self::Input, Self::Output>
where F: Fn(&Self::Output) -> bool + 'a, Self::Input: 'a, Self::Output: 'a,

解析結果をフィルターする[Parser]を返す。
Source§

fn with_filter_not<F>(self, f: F) -> Self
where F: Fn(&Self::Output) -> bool + 'a, Self::Input: 'a, Self::Output: 'a, Self: Sized,

解析結果をフィルターする[Parser]を返す。
Source§

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

Source§

fn map<B, F>(self, f: F) -> Self::P<'a, Self::Input, B>
where F: Fn(Self::Output) -> B + 'a, Self::Input: 'a, Self::Output: Clone + 'a, B: Clone + 'a,

Returns a [Parser] that transforms the analysis results.
解析結果を変換する[Parser]を返す。
Source§

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

Source§

fn flat_map<B, F>(self, f: F) -> Self::P<'a, Self::Input, B>
where F: Fn(Self::Output) -> Self::P<'a, Self::Input, B> + 'a, Self::Input: 'a, Self::Output: 'a, B: 'a,

Returns a Parser that somehow combines the calculations of Parsers.
Parserどうしの計算を何らかの形で結合したParserを返す。
Source§

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

Source§

fn pure<F>(value: F) -> Self::P<'a, Self::Input, Self::Output>
where F: Fn() -> Self::Output + 'a, Self::Input: 'a, Self::Output: 'a,

Returns the specified value [Parser].
指定した値を返す[Parser]を返す。
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

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).
入力を解析する。 Read more
Source§

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>

Source§

fn peek(self) -> Self::P<'a, Self::Input, Self::Output>
where Self::Output: Debug + 'a,

Source§

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

Source§

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,

Source§

fn of_many0(self) -> Self::P<'a, Self::Input, Vec<Self::Output>>
where Self::Output: Debug + 'a,

Source§

fn of_many1(self) -> Self::P<'a, Self::Input, Vec<Self::Output>>
where Self::Output: Debug + 'a,

Source§

fn of_many_n_m( self, n: usize, m: usize, ) -> Self::P<'a, Self::Input, Vec<Self::Output>>
where Self::Output: Debug + 'a,

Source§

fn of_count(self, n: usize) -> Self::P<'a, Self::Input, Vec<Self::Output>>
where Self::Output: Debug + 'a,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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>

Source§

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,

Source§

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,

Source§

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,

Source§

impl<'a, I, A, B> Sub<Parser<'a, I, B>> for Parser<'a, I, A>
where A: Clone + Debug + 'a, B: Clone + Debug + 'a,

Source§

type Output = Parser<'a, I, A>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Parser<'a, I, B>) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

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

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.