create position builder

This commit is contained in:
z7zmey
2018-01-11 20:19:02 +02:00
parent a49fdcf8a0
commit e97b018b72
6 changed files with 1341 additions and 1322 deletions

View File

@@ -2,6 +2,13 @@ package node
// Node interface
type Node interface {
Attributes() map[string]interface{}
Walk(v Visitor)
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
}

View File

@@ -1,7 +0,0 @@
package node
type Visitor interface {
EnterNode(node Node) bool
GetChildrenVisitor(Key string) Visitor
LeaveNode(node Node)
}