MCPcopy Create free account
hub / github.com/z7zmey/php-parser / Walk

Method Walk

node/stmt/n_interface.go:54–82  ·  view source on GitHub ↗

Walk traverses nodes Walk is invoked recursively until v.EnterNode returns true

(v walker.Visitor)

Source from the content-addressed store, hash-verified

52// Walk traverses nodes
53// Walk is invoked recursively until v.EnterNode returns true
54func (n *Interface) Walk(v walker.Visitor) {
55 if v.EnterNode(n) == false {
56 return
57 }
58
59 if n.InterfaceName != nil {
60 v.EnterChildNode("InterfaceName", n)
61 n.InterfaceName.Walk(v)
62 v.LeaveChildNode("InterfaceName", n)
63 }
64
65 if n.Extends != nil {
66 v.EnterChildNode("Extends", n)
67 n.Extends.Walk(v)
68 v.LeaveChildNode("Extends", n)
69 }
70
71 if n.Stmts != nil {
72 v.EnterChildList("Stmts", n)
73 for _, nn := range n.Stmts {
74 if nn != nil {
75 nn.Walk(v)
76 }
77 }
78 v.LeaveChildList("Stmts", n)
79 }
80
81 v.LeaveNode(n)
82}

Callers

nothing calls this directly

Calls 7

EnterNodeMethod · 0.65
EnterChildNodeMethod · 0.65
WalkMethod · 0.65
LeaveChildNodeMethod · 0.65
EnterChildListMethod · 0.65
LeaveChildListMethod · 0.65
LeaveNodeMethod · 0.65

Tested by

no test coverage detected