55 lines
937 B
Go
55 lines
937 B
Go
package expr
|
|
|
|
import (
|
|
"github.com/z7zmey/php-parser/node"
|
|
)
|
|
|
|
type FunctionCall struct {
|
|
attributes map[string]interface{}
|
|
position *node.Position
|
|
Function node.Node
|
|
Arguments []node.Node
|
|
}
|
|
|
|
func NewFunctionCall(Function node.Node, Arguments []node.Node) node.Node {
|
|
return &FunctionCall{
|
|
map[string]interface{}{},
|
|
nil,
|
|
Function,
|
|
Arguments,
|
|
}
|
|
}
|
|
|
|
func (n FunctionCall) Attributes() map[string]interface{} {
|
|
return n.attributes
|
|
}
|
|
|
|
func (n FunctionCall) Position() *node.Position {
|
|
return n.position
|
|
}
|
|
|
|
func (n FunctionCall) SetPosition(p *node.Position) node.Node {
|
|
n.position = p
|
|
return n
|
|
}
|
|
|
|
func (n FunctionCall) Walk(v node.Visitor) {
|
|
if v.EnterNode(n) == false {
|
|
return
|
|
}
|
|
|
|
if n.Function != nil {
|
|
vv := v.GetChildrenVisitor("Function")
|
|
n.Function.Walk(vv)
|
|
}
|
|
|
|
if n.Arguments != nil {
|
|
vv := v.GetChildrenVisitor("Arguments")
|
|
for _, nn := range n.Arguments {
|
|
nn.Walk(vv)
|
|
}
|
|
}
|
|
|
|
v.LeaveNode(n)
|
|
}
|