Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node[T tx.TokenKind, E NodeKind] struct { Token tx.Token[T] Kind E Parent *Node[T, E] Children []*Node[T, E] }
func (*Node[T, E]) SeqBreadthFirst ¶
SeqBreadthFirst performs a breadth-first traversal of the tree beginning at 'Node' 'self'. Each node is yielded one time.
Considering the below tree structure, in breadth-first order the sequence of nodes produced by the iterator would be: A, B, C, D, E, F, G, H.
A
╱ ╲
B C
╱ ╲ ╱ ╲
D E F G
╱
H
func (*Node[T, E]) SeqDepthFirst ¶
SeqBreadthFirst performs a depth-first traversal of the tree beginning at 'Node' 'self'. Each node is yielded one time.
Considering the below tree structure, in depth-first order the sequence of nodes produced by the iterator would be: H, D, E, B, F, G, C, A.
A
╱ ╲
B C
╱ ╲ ╱ ╲
D E F G
╱
H
type NodeKind ¶
type NodeKind interface{ comparable }
Click to show internal directories.
Click to hide internal directories.