php-parser/node/expr/variable.go
2018-01-09 00:30:28 +02:00

44 lines
647 B
Go

package expr
import (
"github.com/z7zmey/php-parser/node"
)
type Variable struct {
position *node.Position
VarName node.Node
}
func NewVariable(VarName node.Node) *Variable {
return &Variable{
nil,
VarName,
}
}
func (n *Variable) Attributes() map[string]interface{} {
return nil
}
func (n *Variable) Position() *node.Position {
return n.position
}
func (n *Variable) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
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)
}