Struct hime_redist::parsers::subtree::SubTree [] [src]

pub struct SubTree { /* fields omitted */ }

Represents a sub-tree in an AST A sub-tree is composed of a root with its children. The children may also have children. The maximum depth of a sub-tree is 2 (root, children and children's children), in which case the root is always a replaceable node. The internal representation of a sub-tree is based on arrays. The organization is that a node's children are immediately following it in the array. For example, the tree A(B(CD)E(FG)) is represented as [ABCDEFG].

Methods

impl SubTree
[src]

[src]

Creates a new sub-tree with the expected size

[src]

Gets the label of the node at the given index

[src]

Sets the label of the node at the given index

[src]

Gets the tree action applied onto the node at the given index

[src]

Sets the tree action applied onto the node at the given index

[src]

Gets the number of children of the node at the given index

[src]

Sets the number of children of the node at the given index

[src]

Gets the total number of nodes in this sub-tree

[src]

Initializes the root of this sub-tree

[src]

Copy the content of this sub-tree to the given sub-tree's buffer beginning at the given index This methods only applies in the case of a depth 1 sub-tree (only a root and its children). The results of this method in the case of a depth 2 sub-tree is undetermined.

[src]

Copy the root's children of this sub-tree to the given sub-tree's buffer beginning at the given index This methods only applies in the case of a depth 2 sub-tree.

[src]

Commits the children of a sub-tree in this buffer to the final ast If the index is 0, the root's children are committed, assuming this is a depth-1 sub-tree. If not, the children of the child at the given index are committed.

[src]

Commits this buffer to the final ast

[src]

Pushes a new node into this buffer

[src]

Moves an item within the buffer

[src]

Moves a range of items within the buffer

Trait Implementations

impl Clone for SubTree
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for SubTree

impl Sync for SubTree