2018-01-17 16:58:45 +00:00
|
|
|
package walker
|
|
|
|
|
2018-02-20 17:52:07 +00:00
|
|
|
// Walkable interface
|
|
|
|
type Walkable interface {
|
2018-01-17 16:58:45 +00:00
|
|
|
Walk(v Visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Visitor interface
|
|
|
|
type Visitor interface {
|
2018-02-20 17:52:07 +00:00
|
|
|
EnterNode(w Walkable) bool // EnterNode invoked for each node encountered by Walk.
|
2018-01-17 16:58:45 +00:00
|
|
|
GetChildrenVisitor(Key string) Visitor // GetChildrenVisitor returns visitor for children nodes
|
2018-02-20 17:52:07 +00:00
|
|
|
LeaveNode(w Walkable) // LeaveNode invoked after process node
|
2018-01-17 16:58:45 +00:00
|
|
|
}
|