pub trait TreeConstruct<'t> {
type Error;
type Tree;
// Required methods
fn open_non_terminal(
&mut self,
name: &'static str,
size_hint: Option<usize>,
) -> Result<(), Self::Error>;
fn close_non_terminal(&mut self) -> Result<(), Self::Error>;
fn add_token(&mut self, token: &Token<'t>) -> Result<(), Self::Error>;
fn build(self) -> Result<Self::Tree, Self::Error>;
}Expand description
A trait that a tree builder must implement.
Required Associated Types§
Required Methods§
Sourcefn open_non_terminal(
&mut self,
name: &'static str,
size_hint: Option<usize>,
) -> Result<(), Self::Error>
fn open_non_terminal( &mut self, name: &'static str, size_hint: Option<usize>, ) -> Result<(), Self::Error>
Creates a node from a non-terminal name.
Sourcefn close_non_terminal(&mut self) -> Result<(), Self::Error>
fn close_non_terminal(&mut self) -> Result<(), Self::Error>
Closes a non-terminal node.