php-parser/node/identifier.go
2018-01-08 21:32:57 +02:00

50 lines
783 B
Go

package node
import "github.com/z7zmey/php-parser/comment"
type Identifier struct {
position *Position
comments *[]comment.Comment
Value string
}
func NewIdentifier(Value string) *Identifier {
return &Identifier{
nil,
nil,
Value,
}
}
func (n *Identifier) Attributes() map[string]interface{} {
return map[string]interface{}{
"Value": n.Value,
}
}
func (n *Identifier) Position() *Position {
return n.position
}
func (n *Identifier) SetPosition(p *Position) Node {
n.position = p
return n
}
func (n *Identifier) Comments() *[]comment.Comment {
return n.comments
}
func (n *Identifier) SetComments(c *[]comment.Comment) Node {
n.comments = c
return n
}
func (n *Identifier) Walk(v Visitor) {
if v.EnterNode(n) == false {
return
}
v.LeaveNode(n)
}