php-parser/node/nullable.go
2018-01-05 00:12:01 +02:00

40 lines
551 B
Go

package node
type Nullable struct {
position *Position
Expr Node
}
func NewNullable(Expression Node) Node {
return &Nullable{
nil,
Expression,
}
}
func (n Nullable) Attributes() map[string]interface{} {
return nil
}
func (n Nullable) Position() *Position {
return n.position
}
func (n Nullable) SetPosition(p *Position) Node {
n.position = p
return n
}
func (n Nullable) Walk(v Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
vv := v.GetChildrenVisitor("Expr")
n.Expr.Walk(vv)
}
v.LeaveNode(n)
}