struct Parser {
src: VecDeque<TokenWithPos>,
}
Fields§
§src: VecDeque<TokenWithPos>
Implementations§
Source§impl Parser
impl Parser
fn new(src: Vec<TokenWithPos>) -> Self
fn peek(&self) -> &TokenWithPos
fn get(&mut self) -> TokenWithPos
Sourcefn parse_formula(&mut self) -> Result<Ast>
fn parse_formula(&mut self) -> Result<Ast>
expr = expr <EOF>
Sourcefn parse_expr(&mut self) -> Result<Ast>
fn parse_expr(&mut self) -> Result<Ast>
expr = term
Sourcefn parse_term(&mut self) -> Result<Ast>
fn parse_term(&mut self) -> Result<Ast>
term = factor ((<+>|<-> factor)*
Sourcefn parse_factor(&mut self) -> Result<Ast>
fn parse_factor(&mut self) -> Result<Ast>
factor = unary (<>|</>|<%> unary)
Sourcefn parse_unary(&mut self) -> Result<Ast>
fn parse_unary(&mut self) -> Result<Ast>
unary = (<+>|<->)* primary
Sourcefn parse_primary(&mut self) -> Result<Ast>
fn parse_primary(&mut self) -> Result<Ast>
primary = <(> expr <)> | <INTEGER>
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more