[][src]Trait pratt::PrattParser

pub trait PrattParser<Inputs> where
    Inputs: Iterator<Item = Self::Input>, 
{ type Error; type Input: Debug; type Output: Sized; fn query(&mut self, input: &Self::Input) -> Option<Affix>;
fn primary(
        &mut self,
        input: Self::Input
    ) -> Result<Self::Output, Self::Error>;
fn infix(
        &mut self,
        lhs: Self::Output,
        op: Self::Input,
        rhs: Self::Output
    ) -> Result<Self::Output, Self::Error>;
fn prefix(
        &mut self,
        op: Self::Input,
        rhs: Self::Output
    ) -> Result<Self::Output, Self::Error>;
fn postfix(
        &mut self,
        lhs: Self::Output,
        op: Self::Input
    ) -> Result<Self::Output, Self::Error>; fn parse(
        &mut self,
        inputs: &mut Inputs
    ) -> Result<Self::Output, Self::Error> { ... }
fn parse_input(
        &mut self,
        inputs: &mut Peekable<&mut Inputs>,
        rbp: Precedence
    ) -> Result<Self::Output, Self::Error> { ... }
fn nud(
        &mut self,
        inputs: &mut Peekable<&mut Inputs>
    ) -> Result<Self::Output, Self::Error> { ... }
fn led(
        &mut self,
        inputs: &mut Peekable<&mut Inputs>,
        lhs: Self::Output
    ) -> Result<Self::Output, Self::Error> { ... }
fn lbp(&mut self, inputs: &mut Peekable<&mut Inputs>) -> Precedence { ... } }

Associated Types

type Error

type Input: Debug

type Output: Sized

Loading content...

Required methods

fn query(&mut self, input: &Self::Input) -> Option<Affix>

fn primary(&mut self, input: Self::Input) -> Result<Self::Output, Self::Error>

fn infix(
    &mut self,
    lhs: Self::Output,
    op: Self::Input,
    rhs: Self::Output
) -> Result<Self::Output, Self::Error>

fn prefix(
    &mut self,
    op: Self::Input,
    rhs: Self::Output
) -> Result<Self::Output, Self::Error>

fn postfix(
    &mut self,
    lhs: Self::Output,
    op: Self::Input
) -> Result<Self::Output, Self::Error>

Loading content...

Provided methods

fn parse(&mut self, inputs: &mut Inputs) -> Result<Self::Output, Self::Error>

fn parse_input(
    &mut self,
    inputs: &mut Peekable<&mut Inputs>,
    rbp: Precedence
) -> Result<Self::Output, Self::Error>

fn nud(
    &mut self,
    inputs: &mut Peekable<&mut Inputs>
) -> Result<Self::Output, Self::Error>

Null-Denotation

fn led(
    &mut self,
    inputs: &mut Peekable<&mut Inputs>,
    lhs: Self::Output
) -> Result<Self::Output, Self::Error>

Left-Denotation

fn lbp(&mut self, inputs: &mut Peekable<&mut Inputs>) -> Precedence

Left-Binding-Power

Loading content...

Implementors

Loading content...