php-parser/node/expr/binary_op/identical.go
2017-12-31 13:15:50 +02:00

65 lines
1.0 KiB
Go

package binary_op
import (
"github.com/z7zmey/php-parser/node"
)
type Identical struct {
BinaryOp
}
func NewIdentical(variable node.Node, expression node.Node) node.Node {
return Identical{
BinaryOp{
"BinaryIdentical",
map[string]interface{}{},
nil,
variable,
expression,
},
}
}
func (n Identical) Name() string {
return "Identical"
}
func (n Identical) Attributes() map[string]interface{} {
return n.attributes
}
func (n Identical) Attribute(key string) interface{} {
return n.attributes[key]
}
func (n Identical) SetAttribute(key string, value interface{}) {
n.attributes[key] = value
}
func (n Identical) Position() *node.Position {
return n.position
}
func (n Identical) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n Identical) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.left != nil {
vv := v.GetChildrenVisitor("left")
n.left.Walk(vv)
}
if n.right != nil {
vv := v.GetChildrenVisitor("right")
n.right.Walk(vv)
}
v.LeaveNode(n)
}