use super::Input;
pub trait Parser<'a, T: Input<'a>> {
type Rule;
type Token;
fn input(&self) -> &T;
fn input_mut(&mut self) -> &mut T;
fn try<F>(&mut self, revert: bool, rule: F) -> bool where F: FnOnce(&mut Self) -> bool;
fn prec_climb<F, G>(&mut self,
pos: usize,
left: usize,
min_prec: u8,
last_op: Option<(Option<Self::Rule>, u8, bool)>,
primary: &mut F,
climb: &mut G)
-> (Option<(Option<Self::Rule>, u8, bool)>, Option<usize>)
where F: FnMut(&mut Self) -> bool,
G: FnMut(&mut Self) -> Option<(Option<Self::Rule>, u8, bool)>;
fn end(&self) -> bool;
fn eoi_matched(&self) -> bool;
fn reset(&mut self);
fn queue(&self) -> &Vec<Self::Token>;
fn queue_mut(&mut self) -> &mut Vec<Self::Token>;
fn queue_index(&self) -> usize;
fn inc_queue_index(&self);
fn set_queue_index(&self, index: usize);
fn skip_ws(&mut self);
fn skip_com(&mut self);
fn is_atomic(&self) -> bool;
fn set_atomic(&mut self, value: bool);
fn track(&mut self, failed: Self::Rule, pos: usize);
fn tracked_len(&self) -> usize;
fn expected(&mut self) -> (Vec<Self::Rule>, usize);
}