pub struct TopDownBuilder { /* private fields */ }
Expand description
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.
Implementations§
Source§impl TopDownBuilder
impl TopDownBuilder
Sourcepub fn new() -> TopDownBuilder
pub fn new() -> TopDownBuilder
Create a new builder.
Sourcepub fn finish(self) -> ParseTree
pub fn finish(self) -> ParseTree
Completes the building process and yields a ParseTree. Panics if there's unmatched
start_internal` calls.
Sourcepub fn start_internal(&mut self, symbol: Symbol)
pub fn start_internal(&mut self, symbol: Symbol)
Start a new internal node.
Sourcepub fn finish_internal(&mut self)
pub fn finish_internal(&mut self)
Complete an internal node.
Panics if there’s no matching start_internal
call.
Trait Implementations§
Source§impl Debug for TopDownBuilder
impl Debug for TopDownBuilder
Source§impl Default for TopDownBuilder
impl Default for TopDownBuilder
Source§fn default() -> TopDownBuilder
fn default() -> TopDownBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TopDownBuilder
impl RefUnwindSafe for TopDownBuilder
impl Send for TopDownBuilder
impl Sync for TopDownBuilder
impl Unpin for TopDownBuilder
impl UnwindSafe for TopDownBuilder
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