pub trait DataStack: Sized + Default {
type Term;
type NonTerm: crate::parser::nonterminal::NonTerminal;
type UserData;
type ReduceActionError;
type StartType;
type Location: crate::Location;
fn pop_start(&mut self) -> Option<Self::StartType>;
fn pop(&mut self);
fn push_terminal(&mut self, term: Self::Term);
fn push_empty(&mut self);
fn clear(&mut self);
fn reserve(&mut self, additional: usize);
fn with_capacity(capacity: usize) -> Self {
let mut self_: Self = Default::default();
self_.reserve(capacity);
self_
}
fn split_off(&mut self, at: usize) -> Self;
fn append(&mut self, other: &mut Self);
fn reduce_action(
data_stack: &mut Self,
location_stack: &mut Vec<Self::Location>,
push_data: bool,
rule_index: usize,
shift: &mut bool,
lookahead: &crate::TerminalSymbol<Self::Term>,
userdata: &mut Self::UserData,
location0: &mut Self::Location,
) -> Result<(), Self::ReduceActionError>;
}