php-parser/walker/walker.go
2018-06-19 22:56:52 +03:00

22 lines
436 B
Go

// Package walker declares walking behavior
package walker
// Walkable interface
//
// Every node must implement this interface
type Walkable interface {
Walk(v Visitor)
}
// Visitor interface
type Visitor interface {
EnterNode(w Walkable) bool
LeaveNode(w Walkable)
EnterChildNode(key string, w Walkable)
LeaveChildNode(key string, w Walkable)
EnterChildList(key string, w Walkable)
LeaveChildList(key string, w Walkable)
}