php-parser/node/expr/post_dec.go
2018-01-04 22:09:48 +02:00

46 lines
717 B
Go

package expr
import (
"github.com/z7zmey/php-parser/node"
)
type PostDec struct {
attributes map[string]interface{}
position *node.Position
variable node.Node
}
func NewPostDec(variable node.Node) node.Node {
return &PostDec{
map[string]interface{}{},
nil,
variable,
}
}
func (n PostDec) Attributes() map[string]interface{} {
return n.attributes
}
func (n PostDec) Position() *node.Position {
return n.position
}
func (n PostDec) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n PostDec) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.variable != nil {
vv := v.GetChildrenVisitor("variable")
n.variable.Walk(vv)
}
v.LeaveNode(n)
}