Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator allows for traversal over a UAST tree.
func NewIterator ¶
NewIterator constructs a new Iterator starting from the given `Node` and iterating with the traversal strategy given by the `order` parameter. Once the iteration have finished or you don't need the iterator anymore you must dispose it with the Dispose() method (or call it with `defer`).
func (*Iterator) Dispose ¶
func (i *Iterator) Dispose()
Dispose must be called once you've finished using the iterator or preventively with `defer` to free the iterator resources. Failing to do so would produce a memory leak.
func (*Iterator) Iterate ¶
Iterate function is similar to Next() but returns the `Node`s in a channel. It's mean to be used with the `for node := range myIter.Iterate() {}` loop.