php-parser/node/node.go

15 lines
521 B
Go
Raw Normal View History

2017-12-03 18:49:18 +00:00
package node
2018-01-11 17:33:25 +00:00
// Node interface
2017-12-31 10:59:22 +00:00
type Node interface {
2018-01-11 18:19:02 +00:00
Attributes() map[string]interface{} // Attributes returns node attributes as map
Walk(v Visitor) // Walk traverses nodes
}
// Visitor interface
type Visitor interface {
EnterNode(node Node) bool // EnterNode invoked for each node encountered by Walk.
GetChildrenVisitor(Key string) Visitor // GetChildrenVisitor returns visitor for children nodes
LeaveNode(node Node) // LeaveNode invoked after process node
2017-12-31 09:57:55 +00:00
}