php-parser/node/expr/variable.go
2017-12-29 17:53:13 +02:00

41 lines
616 B
Go

package expr
import (
"github.com/z7zmey/php-parser/node"
)
type Variable struct {
name string
attributes map[string]interface{}
varName node.Node
}
func NewVariable(varName node.Node) node.Node {
return Variable{
"Variable",
map[string]interface{}{},
varName,
}
}
func (n Variable) Name() string {
return "Variable"
}
func (n Variable) Attributes() map[string]interface{} {
return n.attributes
}
func (n Variable) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.varName != nil {
vv := v.GetChildrenVisitor("varName")
n.varName.Walk(vv)
}
v.LeaveNode(n)
}