node attributes

This commit is contained in:
vadim 2017-12-29 17:20:24 +02:00
parent 722fa00fa3
commit 70a4ef18ab
159 changed files with 2214 additions and 1682 deletions

View File

@ -11,18 +11,19 @@ type dumper struct {
} }
func (d dumper) EnterNode(n node.Node) bool { func (d dumper) EnterNode(n node.Node) bool {
fmt.Printf("%v[%v]:\n", d.indent, n.Name())
fmt.Printf("%v%v", d.indent, n.Name())
if a := n.Attributes(); a != nil {
fmt.Printf(" %v", a)
}
fmt.Println()
return true return true
} }
func (d dumper) GetChildrenVisitor(key string) node.Visitor { func (d dumper) GetChildrenVisitor(key string) node.Visitor {
fmt.Printf("%v%v:\n", d.indent+". ", key) fmt.Printf("%v%q:\n", d.indent+" ", key)
return dumper{d.indent + ". . "} return dumper{d.indent + " "}
}
func (d dumper) Scalar(key string, value interface{}) {
fmt.Printf("%v%v: %v\n", d.indent+". ", key, value)
} }
func (d dumper) LeaveNode(n node.Node) { func (d dumper) LeaveNode(n node.Node) {

View File

@ -1,21 +1,29 @@
package node package node
type Argument struct { type Argument struct {
name string name string
expr Node arguments map[string]interface{}
variadic bool expr Node
variadic bool
}
func NewArgument(expression Node, variadic bool) Node {
return Argument{
"Argument",
map[string]interface{}{
"variadic": variadic,
},
expression,
variadic,
}
} }
func (n Argument) Name() string { func (n Argument) Name() string {
return "Argument" return "Argument"
} }
func NewArgument(expression Node, variadic bool) Node { func (n Argument) Attributes() map[string]interface{} {
return Argument{ return n.arguments
"Argument",
expression,
variadic,
}
} }
func (n Argument) Walk(v Visitor) { func (n Argument) Walk(v Visitor) {

View File

@ -2,27 +2,26 @@ package expr
import ( import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
) )
type Array struct {
name string
items []node.Node
}
func NewArray(items []node.Node) node.Node {
return Array{
"Array",
items,
}
}
func (n Array) Name() string { func (n Array) Name() string {
return "Array" return "Array"
} }
type Array struct { func (n Array) Attributes() map[string]interface{} {
name string return nil
opentToken token.Token
closeToken token.Token
items []node.Node
}
func NewArray(opentToken token.Token, closeToken token.Token, items []node.Node) node.Node {
return Array{
"Array",
opentToken,
closeToken,
items,
}
} }
func (n Array) Walk(v node.Visitor) { func (n Array) Walk(v node.Visitor) {

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ArrayDimFetch) Name() string {
return "ArrayDimFetch"
}
type ArrayDimFetch struct { type ArrayDimFetch struct {
name string name string
variable node.Node variable node.Node
@ -22,6 +18,14 @@ func NewArrayDimFetch(variable node.Node, dim node.Node) node.Node {
} }
} }
func (n ArrayDimFetch) Name() string {
return "ArrayDimFetch"
}
func (n ArrayDimFetch) Attributes() map[string]interface{} {
return nil
}
func (n ArrayDimFetch) Walk(v node.Visitor) { func (n ArrayDimFetch) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,26 +4,32 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ArrayItem) Name() string {
return "ArrayItem"
}
type ArrayItem struct { type ArrayItem struct {
name string name string
key node.Node attributes map[string]interface{}
val node.Node key node.Node
byRef bool val node.Node
} }
func NewArrayItem(key node.Node, val node.Node, byRef bool) node.Node { func NewArrayItem(key node.Node, val node.Node, byRef bool) node.Node {
return ArrayItem{ return ArrayItem{
"ArrayItem", "ArrayItem",
map[string]interface{}{
"byRef": byRef,
},
key, key,
val, val,
byRef,
} }
} }
func (n ArrayItem) Name() string {
return "ArrayItem"
}
func (n ArrayItem) Attributes() map[string]interface{} {
return nil
}
func (n ArrayItem) Walk(v node.Visitor) { func (n ArrayItem) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Assign) Name() string {
return "Assign"
}
type Assign struct { type Assign struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewAssign(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Assign) Name() string {
return "Assign"
}
func (n Assign) Attributes() map[string]interface{} {
return nil
}
func (n Assign) Walk(v node.Visitor) { func (n Assign) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n AssignRef) Name() string {
return "AssignRef"
}
type AssignRef struct { type AssignRef struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewAssignRef(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n AssignRef) Name() string {
return "AssignRef"
}
func (n AssignRef) Attributes() map[string]interface{} {
return nil
}
func (n AssignRef) Walk(v node.Visitor) { func (n AssignRef) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n BitwiseAnd) Name() string {
return "BitwiseAnd"
}
type BitwiseAnd struct { type BitwiseAnd struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n BitwiseAnd) Name() string {
return "BitwiseAnd"
}
func (n BitwiseAnd) Attributes() map[string]interface{} {
return nil
}
func (n BitwiseAnd) Walk(v node.Visitor) { func (n BitwiseAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n BitwiseOr) Name() string {
return "BitwiseOr"
}
type BitwiseOr struct { type BitwiseOr struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n BitwiseOr) Name() string {
return "BitwiseOr"
}
func (n BitwiseOr) Attributes() map[string]interface{} {
return nil
}
func (n BitwiseOr) Walk(v node.Visitor) { func (n BitwiseOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -18,6 +18,10 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n BitwiseXor) Attributes() map[string]interface{} {
return nil
}
func (n BitwiseXor) Name() string { func (n BitwiseXor) Name() string {
return "BitwiseXor" return "BitwiseXor"
} }

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Concat) Name() string {
return "Concat"
}
type Concat struct { type Concat struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Concat) Name() string {
return "Concat"
}
func (n Concat) Attributes() map[string]interface{} {
return nil
}
func (n Concat) Walk(v node.Visitor) { func (n Concat) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Div) Name() string {
return "Div"
}
type Div struct { type Div struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Div) Name() string {
return "Div"
}
func (n Div) Attributes() map[string]interface{} {
return nil
}
func (n Div) Walk(v node.Visitor) { func (n Div) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Minus) Name() string {
return "Minus"
}
type Minus struct { type Minus struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Minus) Name() string {
return "Minus"
}
func (n Minus) Attributes() map[string]interface{} {
return nil
}
func (n Minus) Walk(v node.Visitor) { func (n Minus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Mod) Name() string {
return "Mod"
}
type Mod struct { type Mod struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Mod) Name() string {
return "Mod"
}
func (n Mod) Attributes() map[string]interface{} {
return nil
}
func (n Mod) Walk(v node.Visitor) { func (n Mod) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Mul) Name() string {
return "Mul"
}
type Mul struct { type Mul struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Mul) Name() string {
return "Mul"
}
func (n Mul) Attributes() map[string]interface{} {
return nil
}
func (n Mul) Walk(v node.Visitor) { func (n Mul) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Plus) Name() string {
return "Plus"
}
type Plus struct { type Plus struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Plus) Name() string {
return "Plus"
}
func (n Plus) Attributes() map[string]interface{} {
return nil
}
func (n Plus) Walk(v node.Visitor) { func (n Plus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Pow) Name() string {
return "Pow"
}
type Pow struct { type Pow struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Pow) Name() string {
return "Pow"
}
func (n Pow) Attributes() map[string]interface{} {
return nil
}
func (n Pow) Walk(v node.Visitor) { func (n Pow) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ShiftLeft) Name() string {
return "ShiftLeft"
}
type ShiftLeft struct { type ShiftLeft struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n ShiftLeft) Name() string {
return "ShiftLeft"
}
func (n ShiftLeft) Attributes() map[string]interface{} {
return nil
}
func (n ShiftLeft) Walk(v node.Visitor) { func (n ShiftLeft) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ShiftRight) Name() string {
return "ShiftRight"
}
type ShiftRight struct { type ShiftRight struct {
AssignOp AssignOp
} }
@ -22,6 +18,14 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n ShiftRight) Name() string {
return "ShiftRight"
}
func (n ShiftRight) Attributes() map[string]interface{} {
return nil
}
func (n ShiftRight) Walk(v node.Visitor) { func (n ShiftRight) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n BitwiseAnd) Name() string {
return "BitwiseAnd"
}
type BitwiseAnd struct { type BitwiseAnd struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n BitwiseAnd) Name() string {
return "BitwiseAnd"
}
func (n BitwiseAnd) Attributes() map[string]interface{} {
return nil
}
func (n BitwiseAnd) Walk(v node.Visitor) { func (n BitwiseAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -18,6 +18,10 @@ func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n BitwiseOr) Attributes() map[string]interface{} {
return nil
}
func (n BitwiseOr) Name() string { func (n BitwiseOr) Name() string {
return "BitwiseOr" return "BitwiseOr"
} }

View File

@ -18,6 +18,10 @@ func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n BitwiseXor) Attributes() map[string]interface{} {
return nil
}
func (n BitwiseXor) Name() string { func (n BitwiseXor) Name() string {
return "BitwiseXor" return "BitwiseXor"
} }

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n BooleanAnd) Name() string {
return "BooleanAnd"
}
type BooleanAnd struct { type BooleanAnd struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewBooleanAnd(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n BooleanAnd) Name() string {
return "BooleanAnd"
}
func (n BooleanAnd) Attributes() map[string]interface{} {
return nil
}
func (n BooleanAnd) Walk(v node.Visitor) { func (n BooleanAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n BooleanOr) Name() string {
return "BooleanOr"
}
type BooleanOr struct { type BooleanOr struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewBooleanOr(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n BooleanOr) Name() string {
return "BooleanOr"
}
func (n BooleanOr) Attributes() map[string]interface{} {
return nil
}
func (n BooleanOr) Walk(v node.Visitor) { func (n BooleanOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Coalesce) Name() string {
return "Coalesce"
}
type Coalesce struct { type Coalesce struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewCoalesce(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Coalesce) Name() string {
return "Coalesce"
}
func (n Coalesce) Attributes() map[string]interface{} {
return nil
}
func (n Coalesce) Walk(v node.Visitor) { func (n Coalesce) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Concat) Name() string {
return "Concat"
}
type Concat struct { type Concat struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewConcat(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Concat) Name() string {
return "Concat"
}
func (n Concat) Attributes() map[string]interface{} {
return nil
}
func (n Concat) Walk(v node.Visitor) { func (n Concat) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Div) Name() string {
return "Div"
}
type Div struct { type Div struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewDiv(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Div) Name() string {
return "Div"
}
func (n Div) Attributes() map[string]interface{} {
return nil
}
func (n Div) Walk(v node.Visitor) { func (n Div) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Equal) Name() string {
return "Equal"
}
type Equal struct { type Equal struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewEqual(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Equal) Name() string {
return "Equal"
}
func (n Equal) Attributes() map[string]interface{} {
return nil
}
func (n Equal) Walk(v node.Visitor) { func (n Equal) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Greater) Name() string {
return "Greater"
}
type Greater struct { type Greater struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewGreater(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Greater) Name() string {
return "Greater"
}
func (n Greater) Attributes() map[string]interface{} {
return nil
}
func (n Greater) Walk(v node.Visitor) { func (n Greater) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n GreaterOrEqual) Name() string {
return "GreaterOrEqual"
}
type GreaterOrEqual struct { type GreaterOrEqual struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n GreaterOrEqual) Name() string {
return "GreaterOrEqual"
}
func (n GreaterOrEqual) Attributes() map[string]interface{} {
return nil
}
func (n GreaterOrEqual) Walk(v node.Visitor) { func (n GreaterOrEqual) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Identical) Name() string {
return "Identical"
}
type Identical struct { type Identical struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewIdentical(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Identical) Name() string {
return "Identical"
}
func (n Identical) Attributes() map[string]interface{} {
return nil
}
func (n Identical) Walk(v node.Visitor) { func (n Identical) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n LogicalAnd) Name() string {
return "LogicalAnd"
}
type LogicalAnd struct { type LogicalAnd struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewLogicalAnd(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n LogicalAnd) Name() string {
return "LogicalAnd"
}
func (n LogicalAnd) Attributes() map[string]interface{} {
return nil
}
func (n LogicalAnd) Walk(v node.Visitor) { func (n LogicalAnd) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n LogicalOr) Name() string {
return "LogicalOr"
}
type LogicalOr struct { type LogicalOr struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewLogicalOr(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n LogicalOr) Name() string {
return "LogicalOr"
}
func (n LogicalOr) Attributes() map[string]interface{} {
return nil
}
func (n LogicalOr) Walk(v node.Visitor) { func (n LogicalOr) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n LogicalXor) Name() string {
return "LogicalXor"
}
type LogicalXor struct { type LogicalXor struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewLogicalXor(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n LogicalXor) Name() string {
return "LogicalXor"
}
func (n LogicalXor) Attributes() map[string]interface{} {
return nil
}
func (n LogicalXor) Walk(v node.Visitor) { func (n LogicalXor) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Minus) Name() string {
return "Minus"
}
type Minus struct { type Minus struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewMinus(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Minus) Name() string {
return "Minus"
}
func (n Minus) Attributes() map[string]interface{} {
return nil
}
func (n Minus) Walk(v node.Visitor) { func (n Minus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Mod) Name() string {
return "Mod"
}
type Mod struct { type Mod struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewMod(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Mod) Name() string {
return "Mod"
}
func (n Mod) Attributes() map[string]interface{} {
return nil
}
func (n Mod) Walk(v node.Visitor) { func (n Mod) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Mul) Name() string {
return "Mul"
}
type Mul struct { type Mul struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewMul(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Mul) Name() string {
return "Mul"
}
func (n Mul) Attributes() map[string]interface{} {
return nil
}
func (n Mul) Walk(v node.Visitor) { func (n Mul) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n NotEqual) Name() string {
return "NotEqual"
}
type NotEqual struct { type NotEqual struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewNotEqual(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n NotEqual) Name() string {
return "NotEqual"
}
func (n NotEqual) Attributes() map[string]interface{} {
return nil
}
func (n NotEqual) Walk(v node.Visitor) { func (n NotEqual) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n NotIdentical) Name() string {
return "NotIdentical"
}
type NotIdentical struct { type NotIdentical struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewNotIdentical(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n NotIdentical) Name() string {
return "NotIdentical"
}
func (n NotIdentical) Attributes() map[string]interface{} {
return nil
}
func (n NotIdentical) Walk(v node.Visitor) { func (n NotIdentical) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Plus) Name() string {
return "Plus"
}
type Plus struct { type Plus struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewPlus(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Plus) Name() string {
return "Plus"
}
func (n Plus) Attributes() map[string]interface{} {
return nil
}
func (n Plus) Walk(v node.Visitor) { func (n Plus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Pow) Name() string {
return "Pow"
}
type Pow struct { type Pow struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewPow(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Pow) Name() string {
return "Pow"
}
func (n Pow) Attributes() map[string]interface{} {
return nil
}
func (n Pow) Walk(v node.Visitor) { func (n Pow) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ShiftLeft) Name() string {
return "ShiftLeft"
}
type ShiftLeft struct { type ShiftLeft struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n ShiftLeft) Name() string {
return "ShiftLeft"
}
func (n ShiftLeft) Attributes() map[string]interface{} {
return nil
}
func (n ShiftLeft) Walk(v node.Visitor) { func (n ShiftLeft) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ShiftRight) Name() string {
return "ShiftRight"
}
type ShiftRight struct { type ShiftRight struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewShiftRight(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n ShiftRight) Name() string {
return "ShiftRight"
}
func (n ShiftRight) Attributes() map[string]interface{} {
return nil
}
func (n ShiftRight) Walk(v node.Visitor) { func (n ShiftRight) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Smaller) Name() string {
return "Smaller"
}
type Smaller struct { type Smaller struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewSmaller(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Smaller) Name() string {
return "Smaller"
}
func (n Smaller) Attributes() map[string]interface{} {
return nil
}
func (n Smaller) Walk(v node.Visitor) { func (n Smaller) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n SmallerOrEqual) Name() string {
return "SmallerOrEqual"
}
type SmallerOrEqual struct { type SmallerOrEqual struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n SmallerOrEqual) Name() string {
return "SmallerOrEqual"
}
func (n SmallerOrEqual) Attributes() map[string]interface{} {
return nil
}
func (n SmallerOrEqual) Walk(v node.Visitor) { func (n SmallerOrEqual) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Spaceship) Name() string {
return "Spaceship"
}
type Spaceship struct { type Spaceship struct {
BinaryOp BinaryOp
} }
@ -22,6 +18,14 @@ func NewSpaceship(variable node.Node, expression node.Node) node.Node {
} }
} }
func (n Spaceship) Name() string {
return "Spaceship"
}
func (n Spaceship) Attributes() map[string]interface{} {
return nil
}
func (n Spaceship) Walk(v node.Visitor) { func (n Spaceship) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n BitwiseNot) Name() string {
return "BitwiseNot"
}
type BitwiseNot struct { type BitwiseNot struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewBitwiseNot(expression node.Node) node.Node {
} }
} }
func (n BitwiseNot) Name() string {
return "BitwiseNot"
}
func (n BitwiseNot) Attributes() map[string]interface{} {
return nil
}
func (n BitwiseNot) Walk(v node.Visitor) { func (n BitwiseNot) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n BooleanNot) Name() string {
return "BooleanNot"
}
type BooleanNot struct { type BooleanNot struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewBooleanNot(expression node.Node) node.Node {
} }
} }
func (n BooleanNot) Name() string {
return "BooleanNot"
}
func (n BooleanNot) Attributes() map[string]interface{} {
return nil
}
func (n BooleanNot) Walk(v node.Visitor) { func (n BooleanNot) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n CastArray) Name() string {
return "CastArray"
}
type CastArray struct { type CastArray struct {
Cast Cast
} }
@ -21,6 +17,14 @@ func NewCastArray(expr node.Node) node.Node {
} }
} }
func (n CastArray) Name() string {
return "CastArray"
}
func (n CastArray) Attributes() map[string]interface{} {
return nil
}
func (n CastArray) Walk(v node.Visitor) { func (n CastArray) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n CastBool) Name() string {
return "CastBool"
}
type CastBool struct { type CastBool struct {
Cast Cast
} }
@ -21,6 +17,14 @@ func NewCastBool(expr node.Node) node.Node {
} }
} }
func (n CastBool) Name() string {
return "CastBool"
}
func (n CastBool) Attributes() map[string]interface{} {
return nil
}
func (n CastBool) Walk(v node.Visitor) { func (n CastBool) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n CastDouble) Name() string {
return "CastDouble"
}
type CastDouble struct { type CastDouble struct {
Cast Cast
} }
@ -21,6 +17,14 @@ func NewCastDouble(expr node.Node) node.Node {
} }
} }
func (n CastDouble) Name() string {
return "CastDouble"
}
func (n CastDouble) Attributes() map[string]interface{} {
return nil
}
func (n CastDouble) Walk(v node.Visitor) { func (n CastDouble) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n CastInt) Name() string {
return "CastInt"
}
type CastInt struct { type CastInt struct {
Cast Cast
} }
@ -21,6 +17,14 @@ func NewCastInt(expr node.Node) node.Node {
} }
} }
func (n CastInt) Name() string {
return "CastInt"
}
func (n CastInt) Attributes() map[string]interface{} {
return nil
}
func (n CastInt) Walk(v node.Visitor) { func (n CastInt) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n CastObject) Name() string {
return "CastObject"
}
type CastObject struct { type CastObject struct {
Cast Cast
} }
@ -21,6 +17,14 @@ func NewCastObject(expr node.Node) node.Node {
} }
} }
func (n CastObject) Name() string {
return "CastObject"
}
func (n CastObject) Attributes() map[string]interface{} {
return nil
}
func (n CastObject) Walk(v node.Visitor) { func (n CastObject) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n CastString) Name() string {
return "CastString"
}
type CastString struct { type CastString struct {
Cast Cast
} }
@ -21,6 +17,14 @@ func NewCastString(expr node.Node) node.Node {
} }
} }
func (n CastString) Name() string {
return "CastString"
}
func (n CastString) Attributes() map[string]interface{} {
return nil
}
func (n CastString) Walk(v node.Visitor) { func (n CastString) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n CastUnset) Name() string {
return "CastUnset"
}
type CastUnset struct { type CastUnset struct {
Cast Cast
} }
@ -21,6 +17,14 @@ func NewCastUnset(expr node.Node) node.Node {
} }
} }
func (n CastUnset) Name() string {
return "CastUnset"
}
func (n CastUnset) Attributes() map[string]interface{} {
return nil
}
func (n CastUnset) Walk(v node.Visitor) { func (n CastUnset) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -2,25 +2,27 @@ package expr
import ( import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
) )
func (n ClassConstFetch) Attributes() map[string]interface{} {
return nil
}
func (n ClassConstFetch) Name() string { func (n ClassConstFetch) Name() string {
return "ClassConstFetch" return "ClassConstFetch"
} }
type ClassConstFetch struct { type ClassConstFetch struct {
name string name string
class node.Node class node.Node
constant token.Token constantName node.Node
} }
// TODO: constant must be identifier func NewClassConstFetch(class node.Node, constantName node.Node) node.Node {
func NewClassConstFetch(class node.Node, constant token.Token) node.Node {
return ClassConstFetch{ return ClassConstFetch{
"ClassConstFetch", "ClassConstFetch",
class, class,
constant, constantName,
} }
} }
@ -29,7 +31,10 @@ func (n ClassConstFetch) Walk(v node.Visitor) {
return return
} }
v.Scalar("constant", n.constant.Value) if n.constantName != nil {
vv := v.GetChildrenVisitor("constantName")
n.constantName.Walk(vv)
}
if n.class != nil { if n.class != nil {
vv := v.GetChildrenVisitor("class") vv := v.GetChildrenVisitor("class")

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Clone) Name() string {
return "Clone"
}
type Clone struct { type Clone struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewClone(expression node.Node) node.Node {
} }
} }
func (n Clone) Name() string {
return "Clone"
}
func (n Clone) Attributes() map[string]interface{} {
return nil
}
func (n Clone) Walk(v node.Visitor) { func (n Clone) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,40 +4,42 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Closure) Name() string {
return "Closure"
}
type Closure struct { type Closure struct {
name string name string
params []node.Node attributes map[string]interface{}
uses []node.Node params []node.Node
returnType node.Node uses []node.Node
stmts []node.Node returnType node.Node
isReturnRef bool stmts []node.Node
isStatic bool
} }
func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmts []node.Node, isStatic bool, isReturnRef bool) node.Node { func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmts []node.Node, isStatic bool, isReturnRef bool) node.Node {
return Closure{ return Closure{
"Closure", "Closure",
map[string]interface{}{
"isReturnRef": isReturnRef,
"isStatic": isStatic,
},
params, params,
uses, uses,
returnType, returnType,
stmts, stmts,
isReturnRef,
isStatic,
} }
} }
func (n Closure) Name() string {
return "Closure"
}
func (n Closure) Attributes() map[string]interface{} {
return nil
}
func (n Closure) Walk(v node.Visitor) { func (n Closure) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return
} }
v.Scalar("isStatic", n.isStatic)
v.Scalar("isReturnRef", n.isReturnRef)
if n.params != nil { if n.params != nil {
vv := v.GetChildrenVisitor("params") vv := v.GetChildrenVisitor("params")
for _, nn := range n.params { for _, nn := range n.params {

View File

@ -4,31 +4,35 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ClusureUse) Name() string {
return "ClusureUse"
}
type ClusureUse struct { type ClusureUse struct {
name string name string
variable node.Node attributes map[string]interface{}
byRef bool variable node.Node
} }
func NewClusureUse(variable node.Node, byRef bool) node.Node { func NewClusureUse(variable node.Node, byRef bool) node.Node {
return ClusureUse{ return ClusureUse{
"ClusureUse", "ClusureUse",
map[string]interface{}{
"byRef": byRef,
},
variable, variable,
byRef,
} }
} }
func (n ClusureUse) Name() string {
return "ClusureUse"
}
func (n ClusureUse) Attributes() map[string]interface{} {
return nil
}
func (n ClusureUse) Walk(v node.Visitor) { func (n ClusureUse) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return
} }
v.Scalar("byRef", n.byRef)
if n.variable != nil { if n.variable != nil {
vv := v.GetChildrenVisitor("variable") vv := v.GetChildrenVisitor("variable")
n.variable.Walk(vv) n.variable.Walk(vv)

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ConstFetch) Name() string {
return "ConstFetch"
}
type ConstFetch struct { type ConstFetch struct {
name string name string
constant node.Node constant node.Node
@ -20,6 +16,14 @@ func NewConstFetch(constant node.Node) node.Node {
} }
} }
func (n ConstFetch) Name() string {
return "ConstFetch"
}
func (n ConstFetch) Attributes() map[string]interface{} {
return nil
}
func (n ConstFetch) Walk(v node.Visitor) { func (n ConstFetch) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Empty) Name() string {
return "Empty"
}
type Empty struct { type Empty struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewEmpty(expression node.Node) node.Node {
} }
} }
func (n Empty) Name() string {
return "Empty"
}
func (n Empty) Attributes() map[string]interface{} {
return nil
}
func (n Empty) Walk(v node.Visitor) { func (n Empty) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ErrorSuppress) Name() string {
return "ErrorSuppress"
}
type ErrorSuppress struct { type ErrorSuppress struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewErrorSuppress(expression node.Node) node.Node {
} }
} }
func (n ErrorSuppress) Name() string {
return "ErrorSuppress"
}
func (n ErrorSuppress) Attributes() map[string]interface{} {
return nil
}
func (n ErrorSuppress) Walk(v node.Visitor) { func (n ErrorSuppress) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Eval) Name() string {
return "Eval"
}
type Eval struct { type Eval struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewEval(expression node.Node) node.Node {
} }
} }
func (n Eval) Name() string {
return "Eval"
}
func (n Eval) Attributes() map[string]interface{} {
return nil
}
func (n Eval) Walk(v node.Visitor) { func (n Eval) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,24 +4,30 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Exit) Name() string {
return "Exit"
}
type Exit struct { type Exit struct {
name string name string
expr node.Node attributes map[string]interface{}
isDie bool expr node.Node
} }
func NewExit(expr node.Node, isDie bool) node.Node { func NewExit(expr node.Node, isDie bool) node.Node {
return Exit{ return Exit{
"Exit", "Exit",
map[string]interface{}{
"isDie": isDie,
},
expr, expr,
isDie,
} }
} }
func (n Exit) Name() string {
return "Exit"
}
func (n Exit) Attributes() map[string]interface{} {
return nil
}
func (n Exit) Walk(v node.Visitor) { func (n Exit) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n FunctionCall) Name() string {
return "FunctionCall"
}
type FunctionCall struct { type FunctionCall struct {
name string name string
function node.Node function node.Node
@ -22,6 +18,14 @@ func NewFunctionCall(function node.Node, arguments []node.Node) node.Node {
} }
} }
func (n FunctionCall) Name() string {
return "FunctionCall"
}
func (n FunctionCall) Attributes() map[string]interface{} {
return nil
}
func (n FunctionCall) Walk(v node.Visitor) { func (n FunctionCall) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Include) Name() string {
return "Include"
}
type Include struct { type Include struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewInclude(expression node.Node) node.Node {
} }
} }
func (n Include) Name() string {
return "Include"
}
func (n Include) Attributes() map[string]interface{} {
return nil
}
func (n Include) Walk(v node.Visitor) { func (n Include) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n IncludeOnce) Name() string {
return "IncludeOnce"
}
type IncludeOnce struct { type IncludeOnce struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewIncludeOnce(expression node.Node) node.Node {
} }
} }
func (n IncludeOnce) Name() string {
return "IncludeOnce"
}
func (n IncludeOnce) Attributes() map[string]interface{} {
return nil
}
func (n IncludeOnce) Walk(v node.Visitor) { func (n IncludeOnce) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n InstanceOf) Name() string {
return "InstanceOf"
}
type InstanceOf struct { type InstanceOf struct {
name string name string
expr node.Node expr node.Node
@ -22,6 +18,14 @@ func NewInstanceOf(expr node.Node, class node.Node) node.Node {
} }
} }
func (n InstanceOf) Name() string {
return "InstanceOf"
}
func (n InstanceOf) Attributes() map[string]interface{} {
return nil
}
func (n InstanceOf) Walk(v node.Visitor) { func (n InstanceOf) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Isset) Name() string {
return "Isset"
}
type Isset struct { type Isset struct {
name string name string
variables []node.Node variables []node.Node
@ -20,6 +16,14 @@ func NewIsset(variables []node.Node) node.Node {
} }
} }
func (n Isset) Name() string {
return "Isset"
}
func (n Isset) Attributes() map[string]interface{} {
return nil
}
func (n Isset) Walk(v node.Visitor) { func (n Isset) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n List) Name() string {
return "List"
}
type List struct { type List struct {
name string name string
items []node.Node items []node.Node
@ -20,6 +16,14 @@ func NewList(items []node.Node) node.Node {
} }
} }
func (n List) Name() string {
return "List"
}
func (n List) Attributes() map[string]interface{} {
return nil
}
func (n List) Walk(v node.Visitor) { func (n List) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n MethodCall) Name() string {
return "MethodCall"
}
type MethodCall struct { type MethodCall struct {
name string name string
variable node.Node variable node.Node
@ -24,6 +20,14 @@ func NewMethodCall(variable node.Node, method node.Node, arguments []node.Node)
} }
} }
func (n MethodCall) Name() string {
return "MethodCall"
}
func (n MethodCall) Attributes() map[string]interface{} {
return nil
}
func (n MethodCall) Walk(v node.Visitor) { func (n MethodCall) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n New) Name() string {
return "New"
}
type New struct { type New struct {
name string name string
class node.Node class node.Node
@ -22,6 +18,14 @@ func NewNew(class node.Node, arguments []node.Node) node.Node {
} }
} }
func (n New) Name() string {
return "New"
}
func (n New) Attributes() map[string]interface{} {
return nil
}
func (n New) Walk(v node.Visitor) { func (n New) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,22 +4,26 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n PostDec) Name() string {
return "PostDec"
}
type PostDec struct { type PostDec struct {
name string name string
variable node.Node variable node.Node
} }
func NewPostDec(variableession node.Node) node.Node { func NewPostDec(variable node.Node) node.Node {
return PostDec{ return PostDec{
"PostDec", "PostDec",
variableession, variable,
} }
} }
func (n PostDec) Name() string {
return "PostDec"
}
func (n PostDec) Attributes() map[string]interface{} {
return nil
}
func (n PostDec) Walk(v node.Visitor) { func (n PostDec) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,22 +4,26 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n PostInc) Name() string {
return "PostInc"
}
type PostInc struct { type PostInc struct {
name string name string
variable node.Node variable node.Node
} }
func NewPostInc(variableession node.Node) node.Node { func NewPostInc(variable node.Node) node.Node {
return PostInc{ return PostInc{
"PostInc", "PostInc",
variableession, variable,
} }
} }
func (n PostInc) Name() string {
return "PostInc"
}
func (n PostInc) Attributes() map[string]interface{} {
return nil
}
func (n PostInc) Walk(v node.Visitor) { func (n PostInc) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,22 +4,26 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n PreDec) Name() string {
return "PreDec"
}
type PreDec struct { type PreDec struct {
name string name string
variable node.Node variable node.Node
} }
func NewPreDec(variableession node.Node) node.Node { func NewPreDec(variable node.Node) node.Node {
return PreDec{ return PreDec{
"PreDec", "PreDec",
variableession, variable,
} }
} }
func (n PreDec) Name() string {
return "PreDec"
}
func (n PreDec) Attributes() map[string]interface{} {
return nil
}
func (n PreDec) Walk(v node.Visitor) { func (n PreDec) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,22 +4,26 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n PreInc) Name() string {
return "PreInc"
}
type PreInc struct { type PreInc struct {
name string name string
variable node.Node variable node.Node
} }
func NewPreInc(variableession node.Node) node.Node { func NewPreInc(variable node.Node) node.Node {
return PreInc{ return PreInc{
"PreInc", "PreInc",
variableession, variable,
} }
} }
func (n PreInc) Name() string {
return "PreInc"
}
func (n PreInc) Attributes() map[string]interface{} {
return nil
}
func (n PreInc) Walk(v node.Visitor) { func (n PreInc) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Print) Name() string {
return "Print"
}
type Print struct { type Print struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewPrint(expression node.Node) node.Node {
} }
} }
func (n Print) Name() string {
return "Print"
}
func (n Print) Attributes() map[string]interface{} {
return nil
}
func (n Print) Walk(v node.Visitor) { func (n Print) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n PropertyFetch) Name() string {
return "PropertyFetch"
}
type PropertyFetch struct { type PropertyFetch struct {
name string name string
variable node.Node variable node.Node
@ -22,6 +18,14 @@ func NewPropertyFetch(variable node.Node, property node.Node) node.Node {
} }
} }
func (n PropertyFetch) Name() string {
return "PropertyFetch"
}
func (n PropertyFetch) Attributes() map[string]interface{} {
return nil
}
func (n PropertyFetch) Walk(v node.Visitor) { func (n PropertyFetch) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Require) Name() string {
return "Require"
}
type Require struct { type Require struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewRequire(expression node.Node) node.Node {
} }
} }
func (n Require) Name() string {
return "Require"
}
func (n Require) Attributes() map[string]interface{} {
return nil
}
func (n Require) Walk(v node.Visitor) { func (n Require) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n RequireOnce) Name() string {
return "RequireOnce"
}
type RequireOnce struct { type RequireOnce struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewRequireOnce(expression node.Node) node.Node {
} }
} }
func (n RequireOnce) Name() string {
return "RequireOnce"
}
func (n RequireOnce) Attributes() map[string]interface{} {
return nil
}
func (n RequireOnce) Walk(v node.Visitor) { func (n RequireOnce) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ShellExec) Name() string {
return "ShellExec"
}
type ShellExec struct { type ShellExec struct {
name string name string
parts []node.Node parts []node.Node
@ -20,6 +16,14 @@ func NewShellExec(parts []node.Node) node.Node {
} }
} }
func (n ShellExec) Name() string {
return "ShellExec"
}
func (n ShellExec) Attributes() map[string]interface{} {
return nil
}
func (n ShellExec) Walk(v node.Visitor) { func (n ShellExec) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -2,27 +2,26 @@ package expr
import ( import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
) )
type ShortArray struct {
name string
items []node.Node
}
func NewShortArray(items []node.Node) node.Node {
return ShortArray{
"ShortArray",
items,
}
}
func (n ShortArray) Name() string { func (n ShortArray) Name() string {
return "ShortArray" return "ShortArray"
} }
type ShortArray struct { func (n ShortArray) Attributes() map[string]interface{} {
name string return nil
opentToken token.Token
closeToken token.Token
items []node.Node
}
func NewShortArray(opentToken token.Token, closeToken token.Token, items []node.Node) node.Node {
return ShortArray{
"ShortArray",
opentToken,
closeToken,
items,
}
} }
func (n ShortArray) Walk(v node.Visitor) { func (n ShortArray) Walk(v node.Visitor) {

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n ShortList) Name() string {
return "ShortList"
}
type ShortList struct { type ShortList struct {
name string name string
items []node.Node items []node.Node
@ -20,6 +16,14 @@ func NewShortList(items []node.Node) node.Node {
} }
} }
func (n ShortList) Name() string {
return "ShortList"
}
func (n ShortList) Attributes() map[string]interface{} {
return nil
}
func (n ShortList) Walk(v node.Visitor) { func (n ShortList) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n StaticCall) Name() string {
return "StaticCall"
}
type StaticCall struct { type StaticCall struct {
name string name string
class node.Node class node.Node
@ -24,6 +20,14 @@ func NewStaticCall(class node.Node, call node.Node, arguments []node.Node) node.
} }
} }
func (n StaticCall) Name() string {
return "StaticCall"
}
func (n StaticCall) Attributes() map[string]interface{} {
return nil
}
func (n StaticCall) Walk(v node.Visitor) { func (n StaticCall) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n StaticPropertyFetch) Name() string {
return "StaticPropertyFetch"
}
type StaticPropertyFetch struct { type StaticPropertyFetch struct {
name string name string
class node.Node class node.Node
@ -22,6 +18,14 @@ func NewStaticPropertyFetch(class node.Node, property node.Node) node.Node {
} }
} }
func (n StaticPropertyFetch) Name() string {
return "StaticPropertyFetch"
}
func (n StaticPropertyFetch) Attributes() map[string]interface{} {
return nil
}
func (n StaticPropertyFetch) Walk(v node.Visitor) { func (n StaticPropertyFetch) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Ternary) Name() string {
return "Ternary"
}
type Ternary struct { type Ternary struct {
name string name string
condition node.Node condition node.Node
@ -24,6 +20,14 @@ func NewTernary(condition node.Node, ifTrue node.Node, ifFalse node.Node) node.N
} }
} }
func (n Ternary) Name() string {
return "Ternary"
}
func (n Ternary) Attributes() map[string]interface{} {
return nil
}
func (n Ternary) Walk(v node.Visitor) { func (n Ternary) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n UnaryMinus) Name() string {
return "UnaryMinus"
}
type UnaryMinus struct { type UnaryMinus struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewUnaryMinus(expression node.Node) node.Node {
} }
} }
func (n UnaryMinus) Name() string {
return "UnaryMinus"
}
func (n UnaryMinus) Attributes() map[string]interface{} {
return nil
}
func (n UnaryMinus) Walk(v node.Visitor) { func (n UnaryMinus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n UnaryPlus) Name() string {
return "UnaryPlus"
}
type UnaryPlus struct { type UnaryPlus struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewUnaryPlus(expression node.Node) node.Node {
} }
} }
func (n UnaryPlus) Name() string {
return "UnaryPlus"
}
func (n UnaryPlus) Attributes() map[string]interface{} {
return nil
}
func (n UnaryPlus) Walk(v node.Visitor) { func (n UnaryPlus) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Variable) Name() string {
return "Variable"
}
type Variable struct { type Variable struct {
name string name string
varName node.Node varName node.Node
@ -20,6 +16,14 @@ func NewVariable(varName node.Node) node.Node {
} }
} }
func (n Variable) Name() string {
return "Variable"
}
func (n Variable) Attributes() map[string]interface{} {
return nil
}
func (n Variable) Walk(v node.Visitor) { func (n Variable) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n Yield) Name() string {
return "Yield"
}
type Yield struct { type Yield struct {
name string name string
key node.Node key node.Node
@ -22,6 +18,14 @@ func NewYield(key node.Node, value node.Node) node.Node {
} }
} }
func (n Yield) Name() string {
return "Yield"
}
func (n Yield) Attributes() map[string]interface{} {
return nil
}
func (n Yield) Walk(v node.Visitor) { func (n Yield) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n YieldFrom) Name() string {
return "YieldFrom"
}
type YieldFrom struct { type YieldFrom struct {
name string name string
expr node.Node expr node.Node
@ -20,6 +16,14 @@ func NewYieldFrom(expression node.Node) node.Node {
} }
} }
func (n YieldFrom) Name() string {
return "YieldFrom"
}
func (n YieldFrom) Attributes() map[string]interface{} {
return nil
}
func (n YieldFrom) Walk(v node.Visitor) { func (n YieldFrom) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -5,19 +5,25 @@ import (
) )
type Identifier struct { type Identifier struct {
name string name string
token token.Token attributes map[string]interface{}
}
func NewIdentifier(token token.Token) Node {
return Identifier{
"Identifier",
map[string]interface{}{
"value": token.Value,
},
}
} }
func (n Identifier) Name() string { func (n Identifier) Name() string {
return "Identifier" return "Identifier"
} }
func NewIdentifier(token token.Token) Node { func (n Identifier) Attributes() map[string]interface{} {
return Identifier{ return n.attributes
"Identifier",
token,
}
} }
func (n Identifier) Walk(v Visitor) { func (n Identifier) Walk(v Visitor) {
@ -25,7 +31,5 @@ func (n Identifier) Walk(v Visitor) {
return return
} }
v.Scalar("token", n.token.Value)
v.LeaveNode(n) v.LeaveNode(n)
} }

View File

@ -20,3 +20,7 @@ func NewFullyQualified(parts []node.Node) node.Node {
func (n FullyQualified) Name() string { func (n FullyQualified) Name() string {
return "FullyQualified" return "FullyQualified"
} }
func (n FullyQualified) Attributes() map[string]interface{} {
return nil
}

View File

@ -4,10 +4,6 @@ import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
) )
func (n NameNode) Name() string {
return "Name"
}
type NameNode struct { type NameNode struct {
name string name string
parts []node.Node parts []node.Node
@ -20,6 +16,14 @@ func NewName(parts []node.Node) node.Node {
} }
} }
func (n NameNode) Name() string {
return "Name"
}
func (n NameNode) Attributes() map[string]interface{} {
return nil
}
func (n NameNode) Walk(v node.Visitor) { func (n NameNode) Walk(v node.Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return
@ -31,4 +35,6 @@ func (n NameNode) Walk(v node.Visitor) {
nn.Walk(vv) nn.Walk(vv)
} }
} }
v.LeaveNode(n)
} }

View File

@ -2,23 +2,28 @@ package name
import ( import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
) )
type NamePart struct {
name string
attributes map[string]interface{}
}
func NewNamePart(value string) node.Node {
return NamePart{
"NamePart",
map[string]interface{}{
"value": value,
},
}
}
func (n NamePart) Name() string { func (n NamePart) Name() string {
return "NamePart" return "NamePart"
} }
type NamePart struct { func (n NamePart) Attributes() map[string]interface{} {
name string return n.attributes
token token.Token
}
func NewNamePart(token token.Token) node.Node {
return NamePart{
"NamePart",
token,
}
} }
func (n NamePart) Walk(v node.Visitor) { func (n NamePart) Walk(v node.Visitor) {
@ -26,5 +31,5 @@ func (n NamePart) Walk(v node.Visitor) {
return return
} }
v.Scalar("token", n.token.Value) v.LeaveNode(n)
} }

View File

@ -20,3 +20,7 @@ func NewRelative(parts []node.Node) node.Node {
func (n Relative) Name() string { func (n Relative) Name() string {
return "Relative" return "Relative"
} }
func (n Relative) Attributes() map[string]interface{} {
return nil
}

View File

@ -2,5 +2,6 @@ package node
type Node interface { type Node interface {
Name() string Name() string
Attributes() map[string]interface{}
Walk(v Visitor) Walk(v Visitor)
} }

View File

@ -5,10 +5,6 @@ type Nullable struct {
expr Node expr Node
} }
func (n Nullable) Name() string {
return "Nullable"
}
func NewNullable(expression Node) Node { func NewNullable(expression Node) Node {
return Nullable{ return Nullable{
"Nullable", "Nullable",
@ -16,6 +12,14 @@ func NewNullable(expression Node) Node {
} }
} }
func (n Nullable) Name() string {
return "Nullable"
}
func (n Nullable) Attributes() map[string]interface{} {
return nil
}
func (n Nullable) Walk(v Visitor) { func (n Nullable) Walk(v Visitor) {
if v.EnterNode(n) == false { if v.EnterNode(n) == false {
return return

View File

@ -2,26 +2,31 @@ package node
type Parameter struct { type Parameter struct {
name string name string
attributes map[string]interface{}
variableType Node variableType Node
variable Node variable Node
defaultValue Node defaultValue Node
byRef bool }
variadic bool
func NewParameter(variableType Node, variable Node, defaultValue Node, byRef bool, variadic bool) Node {
return Parameter{
"Parameter",
map[string]interface{}{
"byRef": byRef,
"variadic": variadic,
},
variableType,
variable,
defaultValue,
}
} }
func (n Parameter) Name() string { func (n Parameter) Name() string {
return "Parameter" return "Parameter"
} }
func NewParameter(variableType Node, variable Node, defaultValue Node, byRef bool, variadic bool) Node { func (n Parameter) Attributes() map[string]interface{} {
return Parameter{ return n.attributes
"Parameter",
variableType,
variable,
defaultValue,
byRef,
variadic,
}
} }
func (n Parameter) Walk(v Visitor) { func (n Parameter) Walk(v Visitor) {
@ -29,9 +34,6 @@ func (n Parameter) Walk(v Visitor) {
return return
} }
v.Scalar("byRef", n.byRef)
v.Scalar("variadic", n.variadic)
if n.variableType != nil { if n.variableType != nil {
vv := v.GetChildrenVisitor("variableType") vv := v.GetChildrenVisitor("variableType")
n.variableType.Walk(vv) n.variableType.Walk(vv)

View File

@ -2,23 +2,28 @@ package scalar
import ( import (
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
) )
type Dnumber struct {
name string
attributes map[string]interface{}
}
func NewDnumber(value string) node.Node {
return Dnumber{
"Dnumber",
map[string]interface{}{
"value": value,
},
}
}
func (n Dnumber) Name() string { func (n Dnumber) Name() string {
return "Dnumber" return "Dnumber"
} }
type Dnumber struct { func (n Dnumber) Attributes() map[string]interface{} {
name string return nil
token token.Token
}
func NewDnumber(token token.Token) node.Node {
return Dnumber{
"Dnumber",
token,
}
} }
func (n Dnumber) Walk(v node.Visitor) { func (n Dnumber) Walk(v node.Visitor) {
@ -26,5 +31,5 @@ func (n Dnumber) Walk(v node.Visitor) {
return return
} }
v.Scalar("token", n.token.Value) v.LeaveNode(n)
} }

Some files were not shown because too many files have changed in this diff Show More