iterator

package
v0.0.0-...-6120cfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultBinaryTreeTraversal = &Option{
		Filter: func(node ast.Evaluable) bool {
			_, ok := node.(*ast.BinaryOperationExpr)
			return ok
		},
	}
)

Functions

This section is empty.

Types

type BfsIterator

type BfsIterator interface {
	Iterator
}

func NewBfsIterator

func NewBfsIterator(root ast.Evaluable) BfsIterator

type DfsIterator

type DfsIterator interface {
	Iterator
}

func NewDfsIterator

func NewDfsIterator(root ast.Evaluable, opts ...*Option) DfsIterator

NewDfsIterator returns a preorder traversal iterator

type Filter

type Filter = func(node ast.Evaluable) bool

type Iterator

type Iterator interface {
	Next() ast.Evaluable
	HasNext() bool
}

type Option

type Option struct {
	Filter
}

type PostOrderIterator

type PostOrderIterator interface {
	Iterator
	NextWithMutParent() (next ast.Evaluable, parent *ast.Evaluable, childIdx int)
}

func NewPostOrderIterator

func NewPostOrderIterator(root *ast.Evaluable, opts ...*Option) PostOrderIterator

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL