walk

package
v0.11.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

walk provides functions for visiting the nodes of an ADT tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Features

func Features(x adt.Expr, f func(label adt.Feature, src adt.Node))

Features calls f for all features used in x and indicates whether the feature is used as a reference or not.

Types

type Visitor

type Visitor struct {
	// Feature is invoked for all field names.
	Feature func(f adt.Feature, src adt.Node)

	// Before is invoked for all nodes in pre-order traversal.
	// Returning false prevents the visitor from visiting the node's
	// children.
	Before func(adt.Node) bool
}

A Visitor walks over all elements in an ADT, recursively.

func (*Visitor) Elem added in v0.4.3

func (w *Visitor) Elem(x adt.Elem)

Jump to

Keyboard shortcuts

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