Trait pratt::PrattParser
source · [−]pub trait PrattParser<Inputs>where
Inputs: Iterator<Item = Self::Input>,{
type Error: Display;
type Input: Debug;
type Output: Sized;
fn query(&mut self, input: &Self::Input) -> Result<Affix, Self::Error>;
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: Inputs
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>> { ... }
fn parse_peekable(
&mut self,
inputs: &mut Peekable<Inputs>
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>> { ... }
fn parse_input(
&mut self,
tail: &mut Peekable<Inputs>,
rbp: Precedence
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>> { ... }
fn nud(
&mut self,
head: Self::Input,
tail: &mut Peekable<Inputs>,
info: Affix
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>> { ... }
fn led(
&mut self,
head: Self::Input,
tail: &mut Peekable<Inputs>,
info: Affix,
lhs: Self::Output
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>> { ... }
fn lbp(&mut self, info: Affix) -> Precedence { ... }
fn nbp(&mut self, info: Affix) -> Precedence { ... }
}
Required Associated Types
Required Methods
fn query(&mut self, input: &Self::Input) -> Result<Affix, Self::Error>
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>
Provided Methods
fn parse(
&mut self,
inputs: Inputs
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>>
fn parse_peekable(
&mut self,
inputs: &mut Peekable<Inputs>
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>>
fn parse_input(
&mut self,
tail: &mut Peekable<Inputs>,
rbp: Precedence
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>>
sourcefn nud(
&mut self,
head: Self::Input,
tail: &mut Peekable<Inputs>,
info: Affix
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>>
fn nud(
&mut self,
head: Self::Input,
tail: &mut Peekable<Inputs>,
info: Affix
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>>
Null-Denotation
sourcefn led(
&mut self,
head: Self::Input,
tail: &mut Peekable<Inputs>,
info: Affix,
lhs: Self::Output
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>>
fn led(
&mut self,
head: Self::Input,
tail: &mut Peekable<Inputs>,
info: Affix,
lhs: Self::Output
) -> Result<Self::Output, PrattError<Self::Input, Self::Error>>
Left-Denotation
sourcefn lbp(&mut self, info: Affix) -> Precedence
fn lbp(&mut self, info: Affix) -> Precedence
Left-Binding-Power
sourcefn nbp(&mut self, info: Affix) -> Precedence
fn nbp(&mut self, info: Affix) -> Precedence
Next-Binding-Power