Parser

Trait Parser 

Source
pub trait Parser<It>{
    type Output: Tuple;

    // Required method
    fn parse(&self, it: It) -> ParseResult<Self::Output, It>;

    // Provided method
    fn match_pattern(&self, it: It) -> ParseResult<(), It> { ... }
}
Expand description

Parser trait. Every parser object must implement this trait.

for crate::parse(), crate::match_pattern() functions

Required Associated Types§

Source

type Output: Tuple

Required Methods§

Source

fn parse(&self, it: It) -> ParseResult<Self::Output, It>

Provided Methods§

Source

fn match_pattern(&self, it: It) -> ParseResult<(), It>

Implementations on Foreign Types§

Source§

impl<ParserType, It> Parser<It> for Rc<ParserType>
where It: InputIteratorTrait, ParserType: Parser<It>,

Source§

type Output = <ParserType as Parser<It>>::Output

Source§

fn parse(&self, it: It) -> ParseResult<Self::Output, It>

Source§

fn match_pattern(&self, it: It) -> ParseResult<(), It>

Source§

impl<ParserType, It> Parser<It> for RefCell<ParserType>
where It: InputIteratorTrait, ParserType: Parser<It>,

Source§

type Output = <ParserType as Parser<It>>::Output

Source§

fn parse(&self, it: It) -> ParseResult<Self::Output, It>

Source§

fn match_pattern(&self, it: It) -> ParseResult<(), It>

Implementors§

Source§

impl<'a, Output> Parser<Chars<'a>> for DynBoxChars<Output>
where Output: Tuple,

Source§

type Output = Output

Source§

impl<'a, Output, T> Parser<Cloned<Iter<'a, T>>> for DynBoxSlice<Output, T>
where Output: Tuple, T: Clone,

Source§

type Output = Output

Source§

impl<'a, Output, T> Parser<Copied<Iter<'a, T>>> for DynBoxSliceCopied<Output, T>
where Output: Tuple, T: Copy,

Source§

type Output = Output

Source§

impl<Output, CharType, It> Parser<It> for DictBTreeParser<Output, CharType>
where Output: Clone + Tuple, CharType: Ord, It: InputIteratorTrait + Iterator<Item = CharType> + Clone,

Source§

type Output = Output

Source§

impl<Output, CharType, It> Parser<It> for DictHashMapParser<Output, CharType>
where It: InputIteratorTrait + Iterator<Item = CharType> + Clone, CharType: Hash + Eq, Output: Clone + Tuple,

Source§

type Output = Output