Trait peel::parser::Parser
[−]
[src]
pub trait Parser { type Result; type Variant; fn parse<'a>(&self,
input: &'a [u8],
node: Option<&ParserNode<Self::Result, Self::Variant>>,
arena: Option<&ParserArena<Self::Result, Self::Variant>>,
result: Option<&Vec<Self::Result>>)
-> IResult<&'a [u8], (Self::Result, ParserState)>; fn variant(&self) -> Self::Variant; }
The parsing trait
Associated Types
type Result
The type for result reporting, usually an enum
type Variant
The type of the parser itself, usually an enum
Required Methods
fn parse<'a>(&self,
input: &'a [u8],
node: Option<&ParserNode<Self::Result, Self::Variant>>,
arena: Option<&ParserArena<Self::Result, Self::Variant>>,
result: Option<&Vec<Self::Result>>)
-> IResult<&'a [u8], (Self::Result, ParserState)>
input: &'a [u8],
node: Option<&ParserNode<Self::Result, Self::Variant>>,
arena: Option<&ParserArena<Self::Result, Self::Variant>>,
result: Option<&Vec<Self::Result>>)
-> IResult<&'a [u8], (Self::Result, ParserState)>
Parse using nom and return the result
fn variant(&self) -> Self::Variant
Return the actual enum variant of the parser