Struct parse_tree::TopDownBuilder [−][src]
pub struct TopDownBuilder { /* fields omitted */ }
A builder for creating parse trees by a top-down walk over
the tree nodes. Each start_internal
call must be paired with a
finish_internal
call. Nodes created within a pair of
start_internal
/ finish_internal
calls become children of
the internal node.
Methods
impl TopDownBuilder
[src]
impl TopDownBuilder
pub fn new() -> TopDownBuilder
[src]
pub fn new() -> TopDownBuilder
Create a new builder.
pub fn finish(self) -> ParseTree
[src]
pub fn finish(self) -> ParseTree
Completes the building process and yields a ParseTree. Panics if there's unmatched
start_internal` calls.
pub fn leaf(&mut self, symbol: Symbol, len: TextUnit)
[src]
pub fn leaf(&mut self, symbol: Symbol, len: TextUnit)
Creates a new leaf node.
pub fn start_internal(&mut self, symbol: Symbol)
[src]
pub fn start_internal(&mut self, symbol: Symbol)
Start a new internal node.
pub fn finish_internal(&mut self)
[src]
pub fn finish_internal(&mut self)
Complete an internal node.
Panics if there's no matching start_internal
call.
Trait Implementations
impl Debug for TopDownBuilder
[src]
impl Debug for TopDownBuilder
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for TopDownBuilder
[src]
impl Default for TopDownBuilder
fn default() -> TopDownBuilder
[src]
fn default() -> TopDownBuilder
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for TopDownBuilder
impl Send for TopDownBuilder
impl Sync for TopDownBuilder
impl Sync for TopDownBuilder