php-parser/node/identifier.go
2017-12-29 17:20:24 +02:00

36 lines
530 B
Go

package node
import (
"github.com/z7zmey/php-parser/token"
)
type Identifier struct {
name string
attributes map[string]interface{}
}
func NewIdentifier(token token.Token) Node {
return Identifier{
"Identifier",
map[string]interface{}{
"value": token.Value,
},
}
}
func (n Identifier) Name() string {
return "Identifier"
}
func (n Identifier) Attributes() map[string]interface{} {
return n.attributes
}
func (n Identifier) Walk(v Visitor) {
if v.EnterNode(n) == false {
return
}
v.LeaveNode(n)
}