diff --git a/node/argument.go b/node/argument.go index 2b7cfca..7fae201 100644 --- a/node/argument.go +++ b/node/argument.go @@ -1,10 +1,12 @@ package node +// Argument node type Argument struct { - Variadic bool - Expr Node + Variadic bool // if ... before variable + Expr Node // Exression } +// NewArgument node constuctor func NewArgument(Expression Node, Variadic bool) *Argument { return &Argument{ Variadic, @@ -12,12 +14,15 @@ func NewArgument(Expression Node, Variadic bool) *Argument { } } +// Attributes returns node attributes as map func (n *Argument) Attributes() map[string]interface{} { return map[string]interface{}{ "Variadic": n.Variadic, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Argument) Walk(v Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/array.go b/node/expr/array.go index 1a01da1..d7ce07f 100644 --- a/node/expr/array.go +++ b/node/expr/array.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Array node type Array struct { Items []node.Node } +// NewArray node constuctor func NewArray(Items []node.Node) *Array { return &Array{ Items, } } +// Attributes returns node attributes as map func (n *Array) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Array) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/array_dim_fetch.go b/node/expr/array_dim_fetch.go index 78d514c..25a95c0 100644 --- a/node/expr/array_dim_fetch.go +++ b/node/expr/array_dim_fetch.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ArrayDimFetch node type ArrayDimFetch struct { Variable node.Node Dim node.Node } +// NewArrayDimFetch node constuctor func NewArrayDimFetch(Variable node.Node, Dim node.Node) *ArrayDimFetch { return &ArrayDimFetch{ Variable, @@ -16,10 +18,13 @@ func NewArrayDimFetch(Variable node.Node, Dim node.Node) *ArrayDimFetch { } } +// Attributes returns node attributes as map func (n *ArrayDimFetch) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ArrayDimFetch) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/array_item.go b/node/expr/array_item.go index 4714fc1..f2dfb51 100644 --- a/node/expr/array_item.go +++ b/node/expr/array_item.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ArrayItem node type ArrayItem struct { ByRef bool Key node.Node Val node.Node } +// NewArrayItem node constuctor func NewArrayItem(Key node.Node, Val node.Node, ByRef bool) *ArrayItem { return &ArrayItem{ ByRef, @@ -18,12 +20,15 @@ func NewArrayItem(Key node.Node, Val node.Node, ByRef bool) *ArrayItem { } } +// Attributes returns node attributes as map func (n *ArrayItem) Attributes() map[string]interface{} { return map[string]interface{}{ "ByRef": n.ByRef, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ArrayItem) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/assign.go b/node/expr/assign_op/assign.go index 8cfb86d..8e36d0d 100644 --- a/node/expr/assign_op/assign.go +++ b/node/expr/assign_op/assign.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Assign node type Assign struct { AssignOp } +// NewAssign node constuctor func NewAssign(Variable node.Node, Expression node.Node) *Assign { return &Assign{ AssignOp{ @@ -17,10 +19,13 @@ func NewAssign(Variable node.Node, Expression node.Node) *Assign { } } +// Attributes returns node attributes as map func (n *Assign) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Assign) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/assign_op.go b/node/expr/assign_op/assign_op.go index 65cf395..b2b7aa4 100644 --- a/node/expr/assign_op/assign_op.go +++ b/node/expr/assign_op/assign_op.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// AssignOp node type AssignOp struct { Variable node.Node Expression node.Node diff --git a/node/expr/assign_op/assign_ref.go b/node/expr/assign_op/assign_ref.go index 95e5c05..f42c954 100644 --- a/node/expr/assign_op/assign_ref.go +++ b/node/expr/assign_op/assign_ref.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// AssignRef node type AssignRef struct { AssignOp } +// NewAssignRef node constuctor func NewAssignRef(Variable node.Node, Expression node.Node) *AssignRef { return &AssignRef{ AssignOp{ @@ -17,10 +19,13 @@ func NewAssignRef(Variable node.Node, Expression node.Node) *AssignRef { } } +// Attributes returns node attributes as map func (n *AssignRef) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *AssignRef) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/bitwise_and.go b/node/expr/assign_op/bitwise_and.go index 95e7ed1..af2d70c 100644 --- a/node/expr/assign_op/bitwise_and.go +++ b/node/expr/assign_op/bitwise_and.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BitwiseAnd node type BitwiseAnd struct { AssignOp } +// NewBitwiseAnd node constuctor func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { return &BitwiseAnd{ AssignOp{ @@ -17,10 +19,13 @@ func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { } } +// Attributes returns node attributes as map func (n *BitwiseAnd) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BitwiseAnd) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/bitwise_or.go b/node/expr/assign_op/bitwise_or.go index a4b940f..60534cb 100644 --- a/node/expr/assign_op/bitwise_or.go +++ b/node/expr/assign_op/bitwise_or.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BitwiseOr node type BitwiseOr struct { AssignOp } +// NewBitwiseOr node constuctor func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { return &BitwiseOr{ AssignOp{ @@ -17,10 +19,13 @@ func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { } } +// Attributes returns node attributes as map func (n *BitwiseOr) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BitwiseOr) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/bitwise_xor.go b/node/expr/assign_op/bitwise_xor.go index 60089d8..f7f5cd1 100644 --- a/node/expr/assign_op/bitwise_xor.go +++ b/node/expr/assign_op/bitwise_xor.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BitwiseXor node type BitwiseXor struct { AssignOp } +// NewBitwiseXor node constuctor func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { return &BitwiseXor{ AssignOp{ @@ -17,10 +19,13 @@ func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { } } +// Attributes returns node attributes as map func (n *BitwiseXor) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BitwiseXor) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/concat.go b/node/expr/assign_op/concat.go index c17df8c..5ae02de 100644 --- a/node/expr/assign_op/concat.go +++ b/node/expr/assign_op/concat.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Concat node type Concat struct { AssignOp } +// NewConcat node constuctor func NewConcat(Variable node.Node, Expression node.Node) *Concat { return &Concat{ AssignOp{ @@ -17,10 +19,13 @@ func NewConcat(Variable node.Node, Expression node.Node) *Concat { } } +// Attributes returns node attributes as map func (n *Concat) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Concat) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/div.go b/node/expr/assign_op/div.go index 70475a9..faa462e 100644 --- a/node/expr/assign_op/div.go +++ b/node/expr/assign_op/div.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Div node type Div struct { AssignOp } +// NewDiv node constuctor func NewDiv(Variable node.Node, Expression node.Node) *Div { return &Div{ AssignOp{ @@ -17,10 +19,13 @@ func NewDiv(Variable node.Node, Expression node.Node) *Div { } } +// Attributes returns node attributes as map func (n *Div) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Div) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/minus.go b/node/expr/assign_op/minus.go index 0200930..8734190 100644 --- a/node/expr/assign_op/minus.go +++ b/node/expr/assign_op/minus.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Minus node type Minus struct { AssignOp } +// NewMinus node constuctor func NewMinus(Variable node.Node, Expression node.Node) *Minus { return &Minus{ AssignOp{ @@ -17,10 +19,13 @@ func NewMinus(Variable node.Node, Expression node.Node) *Minus { } } +// Attributes returns node attributes as map func (n *Minus) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Minus) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/mod.go b/node/expr/assign_op/mod.go index a72c664..031de8f 100644 --- a/node/expr/assign_op/mod.go +++ b/node/expr/assign_op/mod.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Mod node type Mod struct { AssignOp } +// NewMod node constuctor func NewMod(Variable node.Node, Expression node.Node) *Mod { return &Mod{ AssignOp{ @@ -17,10 +19,13 @@ func NewMod(Variable node.Node, Expression node.Node) *Mod { } } +// Attributes returns node attributes as map func (n *Mod) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Mod) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/mul.go b/node/expr/assign_op/mul.go index 61f0496..046143e 100644 --- a/node/expr/assign_op/mul.go +++ b/node/expr/assign_op/mul.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Mul node type Mul struct { AssignOp } +// NewMul node constuctor func NewMul(Variable node.Node, Expression node.Node) *Mul { return &Mul{ AssignOp{ @@ -17,10 +19,13 @@ func NewMul(Variable node.Node, Expression node.Node) *Mul { } } +// Attributes returns node attributes as map func (n *Mul) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Mul) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/plus.go b/node/expr/assign_op/plus.go index c3112a7..3887630 100644 --- a/node/expr/assign_op/plus.go +++ b/node/expr/assign_op/plus.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Plus node type Plus struct { AssignOp } +// NewPlus node constuctor func NewPlus(Variable node.Node, Expression node.Node) *Plus { return &Plus{ AssignOp{ @@ -17,10 +19,13 @@ func NewPlus(Variable node.Node, Expression node.Node) *Plus { } } +// Attributes returns node attributes as map func (n *Plus) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Plus) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/pow.go b/node/expr/assign_op/pow.go index dc6d2a6..6e89c60 100644 --- a/node/expr/assign_op/pow.go +++ b/node/expr/assign_op/pow.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Pow node type Pow struct { AssignOp } +// NewPow node constuctor func NewPow(Variable node.Node, Expression node.Node) *Pow { return &Pow{ AssignOp{ @@ -17,10 +19,13 @@ func NewPow(Variable node.Node, Expression node.Node) *Pow { } } +// Attributes returns node attributes as map func (n *Pow) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Pow) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/shift_left.go b/node/expr/assign_op/shift_left.go index e2f529b..caf3149 100644 --- a/node/expr/assign_op/shift_left.go +++ b/node/expr/assign_op/shift_left.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ShiftLeft node type ShiftLeft struct { AssignOp } +// NewShiftLeft node constuctor func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { return &ShiftLeft{ AssignOp{ @@ -17,10 +19,13 @@ func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { } } +// Attributes returns node attributes as map func (n *ShiftLeft) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ShiftLeft) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/assign_op/shift_right.go b/node/expr/assign_op/shift_right.go index ca63d0e..39b0e00 100644 --- a/node/expr/assign_op/shift_right.go +++ b/node/expr/assign_op/shift_right.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ShiftRight node type ShiftRight struct { AssignOp } +// NewShiftRight node constuctor func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { return &ShiftRight{ AssignOp{ @@ -17,10 +19,13 @@ func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { } } +// Attributes returns node attributes as map func (n *ShiftRight) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ShiftRight) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/binary_op.go b/node/expr/binary_op/binary_op.go index 688b672..1d6b925 100644 --- a/node/expr/binary_op/binary_op.go +++ b/node/expr/binary_op/binary_op.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BinaryOp node type BinaryOp struct { Left node.Node Right node.Node diff --git a/node/expr/binary_op/bitwise_and.go b/node/expr/binary_op/bitwise_and.go index 261d977..25bdad3 100644 --- a/node/expr/binary_op/bitwise_and.go +++ b/node/expr/binary_op/bitwise_and.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BitwiseAnd node type BitwiseAnd struct { BinaryOp } +// NewBitwiseAnd node constuctor func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { return &BitwiseAnd{ BinaryOp{ @@ -17,10 +19,13 @@ func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd { } } +// Attributes returns node attributes as map func (n *BitwiseAnd) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BitwiseAnd) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/bitwise_or.go b/node/expr/binary_op/bitwise_or.go index 9ed7645..5114445 100644 --- a/node/expr/binary_op/bitwise_or.go +++ b/node/expr/binary_op/bitwise_or.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BitwiseOr node type BitwiseOr struct { BinaryOp } +// NewBitwiseOr node constuctor func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { return &BitwiseOr{ BinaryOp{ @@ -17,10 +19,13 @@ func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr { } } +// Attributes returns node attributes as map func (n *BitwiseOr) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BitwiseOr) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/bitwise_xor.go b/node/expr/binary_op/bitwise_xor.go index d1a5caf..6c0c18d 100644 --- a/node/expr/binary_op/bitwise_xor.go +++ b/node/expr/binary_op/bitwise_xor.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BitwiseXor node type BitwiseXor struct { BinaryOp } +// NewBitwiseXor node constuctor func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { return &BitwiseXor{ BinaryOp{ @@ -17,10 +19,13 @@ func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor { } } +// Attributes returns node attributes as map func (n *BitwiseXor) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BitwiseXor) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/boolean_and.go b/node/expr/binary_op/boolean_and.go index 529e4ed..e50ef96 100644 --- a/node/expr/binary_op/boolean_and.go +++ b/node/expr/binary_op/boolean_and.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BooleanAnd node type BooleanAnd struct { BinaryOp } +// NewBooleanAnd node constuctor func NewBooleanAnd(Variable node.Node, Expression node.Node) *BooleanAnd { return &BooleanAnd{ BinaryOp{ @@ -17,10 +19,13 @@ func NewBooleanAnd(Variable node.Node, Expression node.Node) *BooleanAnd { } } +// Attributes returns node attributes as map func (n *BooleanAnd) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BooleanAnd) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/boolean_or.go b/node/expr/binary_op/boolean_or.go index 600b51a..2615558 100644 --- a/node/expr/binary_op/boolean_or.go +++ b/node/expr/binary_op/boolean_or.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BooleanOr node type BooleanOr struct { BinaryOp } +// NewBooleanOr node constuctor func NewBooleanOr(Variable node.Node, Expression node.Node) *BooleanOr { return &BooleanOr{ BinaryOp{ @@ -17,10 +19,13 @@ func NewBooleanOr(Variable node.Node, Expression node.Node) *BooleanOr { } } +// Attributes returns node attributes as map func (n *BooleanOr) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BooleanOr) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/coalesce.go b/node/expr/binary_op/coalesce.go index b6d6b9f..82d48fa 100644 --- a/node/expr/binary_op/coalesce.go +++ b/node/expr/binary_op/coalesce.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Coalesce node type Coalesce struct { BinaryOp } +// NewCoalesce node constuctor func NewCoalesce(Variable node.Node, Expression node.Node) *Coalesce { return &Coalesce{ BinaryOp{ @@ -17,10 +19,13 @@ func NewCoalesce(Variable node.Node, Expression node.Node) *Coalesce { } } +// Attributes returns node attributes as map func (n *Coalesce) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Coalesce) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/concat.go b/node/expr/binary_op/concat.go index 8d6500a..5ee11d5 100644 --- a/node/expr/binary_op/concat.go +++ b/node/expr/binary_op/concat.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Concat node type Concat struct { BinaryOp } +// NewConcat node constuctor func NewConcat(Variable node.Node, Expression node.Node) *Concat { return &Concat{ BinaryOp{ @@ -17,10 +19,13 @@ func NewConcat(Variable node.Node, Expression node.Node) *Concat { } } +// Attributes returns node attributes as map func (n *Concat) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Concat) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/div.go b/node/expr/binary_op/div.go index 449e3c5..155047c 100644 --- a/node/expr/binary_op/div.go +++ b/node/expr/binary_op/div.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Div node type Div struct { BinaryOp } +// NewDiv node constuctor func NewDiv(Variable node.Node, Expression node.Node) *Div { return &Div{ BinaryOp{ @@ -17,10 +19,13 @@ func NewDiv(Variable node.Node, Expression node.Node) *Div { } } +// Attributes returns node attributes as map func (n *Div) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Div) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/equal.go b/node/expr/binary_op/equal.go index 56af714..931aa32 100644 --- a/node/expr/binary_op/equal.go +++ b/node/expr/binary_op/equal.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Equal node type Equal struct { BinaryOp } +// NewEqual node constuctor func NewEqual(Variable node.Node, Expression node.Node) *Equal { return &Equal{ BinaryOp{ @@ -17,10 +19,13 @@ func NewEqual(Variable node.Node, Expression node.Node) *Equal { } } +// Attributes returns node attributes as map func (n *Equal) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Equal) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/greater.go b/node/expr/binary_op/greater.go index 1c02639..558b3f7 100644 --- a/node/expr/binary_op/greater.go +++ b/node/expr/binary_op/greater.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Greater node type Greater struct { BinaryOp } +// NewGreater node constuctor func NewGreater(Variable node.Node, Expression node.Node) *Greater { return &Greater{ BinaryOp{ @@ -17,10 +19,13 @@ func NewGreater(Variable node.Node, Expression node.Node) *Greater { } } +// Attributes returns node attributes as map func (n *Greater) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Greater) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/greater_or_equal.go b/node/expr/binary_op/greater_or_equal.go index 8d3c3e6..b378e91 100644 --- a/node/expr/binary_op/greater_or_equal.go +++ b/node/expr/binary_op/greater_or_equal.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// GreaterOrEqual node type GreaterOrEqual struct { BinaryOp } +// NewGreaterOrEqual node constuctor func NewGreaterOrEqual(Variable node.Node, Expression node.Node) *GreaterOrEqual { return &GreaterOrEqual{ BinaryOp{ @@ -17,10 +19,13 @@ func NewGreaterOrEqual(Variable node.Node, Expression node.Node) *GreaterOrEqual } } +// Attributes returns node attributes as map func (n *GreaterOrEqual) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *GreaterOrEqual) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/identical.go b/node/expr/binary_op/identical.go index 4f84584..2763822 100644 --- a/node/expr/binary_op/identical.go +++ b/node/expr/binary_op/identical.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Identical node type Identical struct { BinaryOp } +// NewIdentical node constuctor func NewIdentical(Variable node.Node, Expression node.Node) *Identical { return &Identical{ BinaryOp{ @@ -17,10 +19,13 @@ func NewIdentical(Variable node.Node, Expression node.Node) *Identical { } } +// Attributes returns node attributes as map func (n *Identical) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Identical) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/logical_and.go b/node/expr/binary_op/logical_and.go index c823a13..17790eb 100644 --- a/node/expr/binary_op/logical_and.go +++ b/node/expr/binary_op/logical_and.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// LogicalAnd node type LogicalAnd struct { BinaryOp } +// NewLogicalAnd node constuctor func NewLogicalAnd(Variable node.Node, Expression node.Node) *LogicalAnd { return &LogicalAnd{ BinaryOp{ @@ -17,10 +19,13 @@ func NewLogicalAnd(Variable node.Node, Expression node.Node) *LogicalAnd { } } +// Attributes returns node attributes as map func (n *LogicalAnd) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *LogicalAnd) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/logical_or.go b/node/expr/binary_op/logical_or.go index 42e19cb..341198f 100644 --- a/node/expr/binary_op/logical_or.go +++ b/node/expr/binary_op/logical_or.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// LogicalOr node type LogicalOr struct { BinaryOp } +// NewLogicalOr node constuctor func NewLogicalOr(Variable node.Node, Expression node.Node) *LogicalOr { return &LogicalOr{ BinaryOp{ @@ -17,10 +19,13 @@ func NewLogicalOr(Variable node.Node, Expression node.Node) *LogicalOr { } } +// Attributes returns node attributes as map func (n *LogicalOr) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *LogicalOr) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/logical_xor.go b/node/expr/binary_op/logical_xor.go index 383af6b..4f1db5d 100644 --- a/node/expr/binary_op/logical_xor.go +++ b/node/expr/binary_op/logical_xor.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// LogicalXor node type LogicalXor struct { BinaryOp } +// NewLogicalXor node constuctor func NewLogicalXor(Variable node.Node, Expression node.Node) *LogicalXor { return &LogicalXor{ BinaryOp{ @@ -17,10 +19,13 @@ func NewLogicalXor(Variable node.Node, Expression node.Node) *LogicalXor { } } +// Attributes returns node attributes as map func (n *LogicalXor) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *LogicalXor) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/minus.go b/node/expr/binary_op/minus.go index 59b3dea..ddaba52 100644 --- a/node/expr/binary_op/minus.go +++ b/node/expr/binary_op/minus.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Minus node type Minus struct { BinaryOp } +// NewMinus node constuctor func NewMinus(Variable node.Node, Expression node.Node) *Minus { return &Minus{ BinaryOp{ @@ -17,10 +19,13 @@ func NewMinus(Variable node.Node, Expression node.Node) *Minus { } } +// Attributes returns node attributes as map func (n *Minus) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Minus) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/mod.go b/node/expr/binary_op/mod.go index 154022a..39a1e5f 100644 --- a/node/expr/binary_op/mod.go +++ b/node/expr/binary_op/mod.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Mod node type Mod struct { BinaryOp } +// NewMod node constuctor func NewMod(Variable node.Node, Expression node.Node) *Mod { return &Mod{ BinaryOp{ @@ -17,10 +19,13 @@ func NewMod(Variable node.Node, Expression node.Node) *Mod { } } +// Attributes returns node attributes as map func (n *Mod) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Mod) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/mul.go b/node/expr/binary_op/mul.go index 76d88c3..15f6383 100644 --- a/node/expr/binary_op/mul.go +++ b/node/expr/binary_op/mul.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Mul node type Mul struct { BinaryOp } +// NewMul node constuctor func NewMul(Variable node.Node, Expression node.Node) *Mul { return &Mul{ BinaryOp{ @@ -17,10 +19,13 @@ func NewMul(Variable node.Node, Expression node.Node) *Mul { } } +// Attributes returns node attributes as map func (n *Mul) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Mul) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/not_equal.go b/node/expr/binary_op/not_equal.go index 49cba8b..2d8f7ad 100644 --- a/node/expr/binary_op/not_equal.go +++ b/node/expr/binary_op/not_equal.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// NotEqual node type NotEqual struct { BinaryOp } +// NewNotEqual node constuctor func NewNotEqual(Variable node.Node, Expression node.Node) *NotEqual { return &NotEqual{ BinaryOp{ @@ -17,10 +19,13 @@ func NewNotEqual(Variable node.Node, Expression node.Node) *NotEqual { } } +// Attributes returns node attributes as map func (n *NotEqual) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *NotEqual) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/not_identical.go b/node/expr/binary_op/not_identical.go index d41dbb2..7fe87ee 100644 --- a/node/expr/binary_op/not_identical.go +++ b/node/expr/binary_op/not_identical.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// NotIdentical node type NotIdentical struct { BinaryOp } +// NewNotIdentical node constuctor func NewNotIdentical(Variable node.Node, Expression node.Node) *NotIdentical { return &NotIdentical{ BinaryOp{ @@ -17,10 +19,13 @@ func NewNotIdentical(Variable node.Node, Expression node.Node) *NotIdentical { } } +// Attributes returns node attributes as map func (n *NotIdentical) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *NotIdentical) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/plus.go b/node/expr/binary_op/plus.go index 8bfb88c..60b9131 100644 --- a/node/expr/binary_op/plus.go +++ b/node/expr/binary_op/plus.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Plus node type Plus struct { BinaryOp } +// NewPlus node constuctor func NewPlus(Variable node.Node, Expression node.Node) *Plus { return &Plus{ BinaryOp{ @@ -17,10 +19,13 @@ func NewPlus(Variable node.Node, Expression node.Node) *Plus { } } +// Attributes returns node attributes as map func (n *Plus) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Plus) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/pow.go b/node/expr/binary_op/pow.go index 611cf6e..352243b 100644 --- a/node/expr/binary_op/pow.go +++ b/node/expr/binary_op/pow.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Pow node type Pow struct { BinaryOp } +// NewPow node constuctor func NewPow(Variable node.Node, Expression node.Node) *Pow { return &Pow{ BinaryOp{ @@ -17,10 +19,13 @@ func NewPow(Variable node.Node, Expression node.Node) *Pow { } } +// Attributes returns node attributes as map func (n *Pow) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Pow) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/shift_left.go b/node/expr/binary_op/shift_left.go index 0f89791..918d2ef 100644 --- a/node/expr/binary_op/shift_left.go +++ b/node/expr/binary_op/shift_left.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ShiftLeft node type ShiftLeft struct { BinaryOp } +// NewShiftLeft node constuctor func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { return &ShiftLeft{ BinaryOp{ @@ -17,10 +19,13 @@ func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft { } } +// Attributes returns node attributes as map func (n *ShiftLeft) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ShiftLeft) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/shift_right.go b/node/expr/binary_op/shift_right.go index 404f39f..d8892a1 100644 --- a/node/expr/binary_op/shift_right.go +++ b/node/expr/binary_op/shift_right.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ShiftRight node type ShiftRight struct { BinaryOp } +// NewShiftRight node constuctor func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { return &ShiftRight{ BinaryOp{ @@ -17,10 +19,13 @@ func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight { } } +// Attributes returns node attributes as map func (n *ShiftRight) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ShiftRight) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/smaller.go b/node/expr/binary_op/smaller.go index efe65df..d2fce78 100644 --- a/node/expr/binary_op/smaller.go +++ b/node/expr/binary_op/smaller.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Smaller node type Smaller struct { BinaryOp } +// NewSmaller node constuctor func NewSmaller(Variable node.Node, Expression node.Node) *Smaller { return &Smaller{ BinaryOp{ @@ -17,10 +19,13 @@ func NewSmaller(Variable node.Node, Expression node.Node) *Smaller { } } +// Attributes returns node attributes as map func (n *Smaller) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Smaller) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/smaller_or_equal.go b/node/expr/binary_op/smaller_or_equal.go index a2ef125..ab5905c 100644 --- a/node/expr/binary_op/smaller_or_equal.go +++ b/node/expr/binary_op/smaller_or_equal.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// SmallerOrEqual node type SmallerOrEqual struct { BinaryOp } +// NewSmallerOrEqual node constuctor func NewSmallerOrEqual(Variable node.Node, Expression node.Node) *SmallerOrEqual { return &SmallerOrEqual{ BinaryOp{ @@ -17,10 +19,13 @@ func NewSmallerOrEqual(Variable node.Node, Expression node.Node) *SmallerOrEqual } } +// Attributes returns node attributes as map func (n *SmallerOrEqual) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *SmallerOrEqual) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/binary_op/spaceship.go b/node/expr/binary_op/spaceship.go index df39615..4eb48e9 100644 --- a/node/expr/binary_op/spaceship.go +++ b/node/expr/binary_op/spaceship.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Spaceship node type Spaceship struct { BinaryOp } +// NewSpaceship node constuctor func NewSpaceship(Variable node.Node, Expression node.Node) *Spaceship { return &Spaceship{ BinaryOp{ @@ -17,10 +19,13 @@ func NewSpaceship(Variable node.Node, Expression node.Node) *Spaceship { } } +// Attributes returns node attributes as map func (n *Spaceship) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Spaceship) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/bitwise_not.go b/node/expr/bitwise_not.go index e680a65..e90309f 100644 --- a/node/expr/bitwise_not.go +++ b/node/expr/bitwise_not.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BitwiseNot node type BitwiseNot struct { Expr node.Node } +// NewBitwiseNot node constuctor func NewBitwiseNot(Expression node.Node) *BitwiseNot { return &BitwiseNot{ Expression, } } +// Attributes returns node attributes as map func (n *BitwiseNot) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BitwiseNot) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/boolean_not.go b/node/expr/boolean_not.go index 171b90e..09a6285 100644 --- a/node/expr/boolean_not.go +++ b/node/expr/boolean_not.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// BooleanNot node type BooleanNot struct { Expr node.Node } +// NewBooleanNot node constuctor func NewBooleanNot(Expression node.Node) *BooleanNot { return &BooleanNot{ Expression, } } +// Attributes returns node attributes as map func (n *BooleanNot) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *BooleanNot) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/cast/cast.go b/node/expr/cast/cast.go index 62e20f3..f6b9245 100644 --- a/node/expr/cast/cast.go +++ b/node/expr/cast/cast.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Cast node type Cast struct { Expr node.Node } diff --git a/node/expr/cast/cast_array.go b/node/expr/cast/cast_array.go index 3df1a43..ccff06b 100644 --- a/node/expr/cast/cast_array.go +++ b/node/expr/cast/cast_array.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// CastArray node type CastArray struct { Cast } +// NewCastArray node constuctor func NewCastArray(Expr node.Node) *CastArray { return &CastArray{ Cast{ @@ -16,10 +18,13 @@ func NewCastArray(Expr node.Node) *CastArray { } } +// Attributes returns node attributes as map func (n *CastArray) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *CastArray) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/cast/cast_bool.go b/node/expr/cast/cast_bool.go index e036a03..a7e1cda 100644 --- a/node/expr/cast/cast_bool.go +++ b/node/expr/cast/cast_bool.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// CastBool node type CastBool struct { Cast } +// NewCastBool node constuctor func NewCastBool(Expr node.Node) *CastBool { return &CastBool{ Cast{ @@ -16,10 +18,13 @@ func NewCastBool(Expr node.Node) *CastBool { } } +// Attributes returns node attributes as map func (n *CastBool) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *CastBool) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/cast/cast_double.go b/node/expr/cast/cast_double.go index 596bea6..d76c72f 100644 --- a/node/expr/cast/cast_double.go +++ b/node/expr/cast/cast_double.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// CastDouble node type CastDouble struct { Cast } +// NewCastDouble node constuctor func NewCastDouble(Expr node.Node) *CastDouble { return &CastDouble{ Cast{ @@ -16,10 +18,13 @@ func NewCastDouble(Expr node.Node) *CastDouble { } } +// Attributes returns node attributes as map func (n *CastDouble) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *CastDouble) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/cast/cast_int.go b/node/expr/cast/cast_int.go index 7777d2b..4372707 100644 --- a/node/expr/cast/cast_int.go +++ b/node/expr/cast/cast_int.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// CastInt node type CastInt struct { Cast } +// NewCastInt node constuctor func NewCastInt(Expr node.Node) *CastInt { return &CastInt{ Cast{ @@ -16,10 +18,13 @@ func NewCastInt(Expr node.Node) *CastInt { } } +// Attributes returns node attributes as map func (n *CastInt) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *CastInt) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/cast/cast_object.go b/node/expr/cast/cast_object.go index a066478..6ba2a28 100644 --- a/node/expr/cast/cast_object.go +++ b/node/expr/cast/cast_object.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// CastObject node type CastObject struct { Cast } +// NewCastObject node constuctor func NewCastObject(Expr node.Node) *CastObject { return &CastObject{ Cast{ @@ -16,10 +18,13 @@ func NewCastObject(Expr node.Node) *CastObject { } } +// Attributes returns node attributes as map func (n *CastObject) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *CastObject) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/cast/cast_string.go b/node/expr/cast/cast_string.go index ed0ef44..d40ef4d 100644 --- a/node/expr/cast/cast_string.go +++ b/node/expr/cast/cast_string.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// CastString node type CastString struct { Cast } +// NewCastString node constuctor func NewCastString(Expr node.Node) *CastString { return &CastString{ Cast{ @@ -16,10 +18,13 @@ func NewCastString(Expr node.Node) *CastString { } } +// Attributes returns node attributes as map func (n *CastString) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *CastString) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/cast/cast_unset.go b/node/expr/cast/cast_unset.go index 09588fd..5a1028f 100644 --- a/node/expr/cast/cast_unset.go +++ b/node/expr/cast/cast_unset.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// CastUnset node type CastUnset struct { Cast } +// NewCastUnset node constuctor func NewCastUnset(Expr node.Node) *CastUnset { return &CastUnset{ Cast{ @@ -16,10 +18,13 @@ func NewCastUnset(Expr node.Node) *CastUnset { } } +// Attributes returns node attributes as map func (n *CastUnset) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *CastUnset) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/class_const_fetch.go b/node/expr/class_const_fetch.go index 4fe2ea8..84ae0a4 100644 --- a/node/expr/class_const_fetch.go +++ b/node/expr/class_const_fetch.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ClassConstFetch node type ClassConstFetch struct { Class node.Node ConstantName node.Node } +// NewClassConstFetch node constuctor func NewClassConstFetch(Class node.Node, ConstantName node.Node) *ClassConstFetch { return &ClassConstFetch{ Class, @@ -16,10 +18,13 @@ func NewClassConstFetch(Class node.Node, ConstantName node.Node) *ClassConstFetc } } +// Attributes returns node attributes as map func (n *ClassConstFetch) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ClassConstFetch) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/clone.go b/node/expr/clone.go index 6d054d6..1313335 100644 --- a/node/expr/clone.go +++ b/node/expr/clone.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Clone node type Clone struct { Expr node.Node } +// NewClone node constuctor func NewClone(Expression node.Node) *Clone { return &Clone{ Expression, } } +// Attributes returns node attributes as map func (n *Clone) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Clone) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/closure.go b/node/expr/closure.go index d12e60a..b4a20de 100644 --- a/node/expr/closure.go +++ b/node/expr/closure.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Closure node type Closure struct { ReturnsRef bool Static bool @@ -14,6 +15,7 @@ type Closure struct { Stmts []node.Node } +// NewClosure node constuctor func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmts []node.Node, Static bool, ReturnsRef bool, PhpDocComment string) *Closure { return &Closure{ ReturnsRef, @@ -26,6 +28,7 @@ func NewClosure(Params []node.Node, Uses []node.Node, ReturnType node.Node, Stmt } } +// Attributes returns node attributes as map func (n *Closure) Attributes() map[string]interface{} { return map[string]interface{}{ "ReturnsRef": n.ReturnsRef, @@ -34,6 +37,8 @@ func (n *Closure) Attributes() map[string]interface{} { } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Closure) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/closure_use.go b/node/expr/closure_use.go index de46fe7..8be613c 100644 --- a/node/expr/closure_use.go +++ b/node/expr/closure_use.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ClusureUse node type ClusureUse struct { ByRef bool Variable node.Node } +// NewClusureUse node constuctor func NewClusureUse(Variable node.Node, ByRef bool) *ClusureUse { return &ClusureUse{ ByRef, @@ -16,12 +18,15 @@ func NewClusureUse(Variable node.Node, ByRef bool) *ClusureUse { } } +// Attributes returns node attributes as map func (n *ClusureUse) Attributes() map[string]interface{} { return map[string]interface{}{ "ByRef": n.ByRef, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ClusureUse) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/const_fetch.go b/node/expr/const_fetch.go index 9759442..c8bcea9 100644 --- a/node/expr/const_fetch.go +++ b/node/expr/const_fetch.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ConstFetch node type ConstFetch struct { Constant node.Node } +// NewConstFetch node constuctor func NewConstFetch(Constant node.Node) *ConstFetch { return &ConstFetch{ Constant, } } +// Attributes returns node attributes as map func (n *ConstFetch) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ConstFetch) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/empty.go b/node/expr/empty.go index 9e826fa..4fb986a 100644 --- a/node/expr/empty.go +++ b/node/expr/empty.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Empty node type Empty struct { Expr node.Node } +// NewEmpty node constuctor func NewEmpty(Expression node.Node) *Empty { return &Empty{ Expression, } } +// Attributes returns node attributes as map func (n *Empty) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Empty) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/error_suppress.go b/node/expr/error_suppress.go index e502de3..26f5f8d 100644 --- a/node/expr/error_suppress.go +++ b/node/expr/error_suppress.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ErrorSuppress node type ErrorSuppress struct { Expr node.Node } +// NewErrorSuppress node constuctor func NewErrorSuppress(Expression node.Node) *ErrorSuppress { return &ErrorSuppress{ Expression, } } +// Attributes returns node attributes as map func (n *ErrorSuppress) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ErrorSuppress) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/eval.go b/node/expr/eval.go index 56f2feb..dd7c37a 100644 --- a/node/expr/eval.go +++ b/node/expr/eval.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Eval node type Eval struct { Expr node.Node } +// NewEval node constuctor func NewEval(Expression node.Node) *Eval { return &Eval{ Expression, } } +// Attributes returns node attributes as map func (n *Eval) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Eval) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/exit.go b/node/expr/exit.go index 5ecf4fb..653ae93 100644 --- a/node/expr/exit.go +++ b/node/expr/exit.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Exit node type Exit struct { Expr node.Node IsDie bool } +// NewExit node constuctor func NewExit(Expr node.Node, IsDie bool) *Exit { return &Exit{ Expr, @@ -16,12 +18,15 @@ func NewExit(Expr node.Node, IsDie bool) *Exit { } } +// Attributes returns node attributes as map func (n *Exit) Attributes() map[string]interface{} { return map[string]interface{}{ "IsDie": n.IsDie, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Exit) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/function_call.go b/node/expr/function_call.go index 8e49c96..d7fdfe3 100644 --- a/node/expr/function_call.go +++ b/node/expr/function_call.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// FunctionCall node type FunctionCall struct { Function node.Node Arguments []node.Node } +// NewFunctionCall node constuctor func NewFunctionCall(Function node.Node, Arguments []node.Node) *FunctionCall { return &FunctionCall{ Function, @@ -16,10 +18,13 @@ func NewFunctionCall(Function node.Node, Arguments []node.Node) *FunctionCall { } } +// Attributes returns node attributes as map func (n *FunctionCall) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *FunctionCall) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/include.go b/node/expr/include.go index fe7c382..c986a09 100644 --- a/node/expr/include.go +++ b/node/expr/include.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Include node type Include struct { Expr node.Node } +// NewInclude node constuctor func NewInclude(Expression node.Node) *Include { return &Include{ Expression, } } +// Attributes returns node attributes as map func (n *Include) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Include) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/include_once.go b/node/expr/include_once.go index 5d20d6d..00b2d88 100644 --- a/node/expr/include_once.go +++ b/node/expr/include_once.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// IncludeOnce node type IncludeOnce struct { Expr node.Node } +// NewIncludeOnce node constuctor func NewIncludeOnce(Expression node.Node) *IncludeOnce { return &IncludeOnce{ Expression, } } +// Attributes returns node attributes as map func (n *IncludeOnce) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *IncludeOnce) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/instance_of.go b/node/expr/instance_of.go index 6154c27..27cb2a1 100644 --- a/node/expr/instance_of.go +++ b/node/expr/instance_of.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// InstanceOf node type InstanceOf struct { Expr node.Node Class node.Node } +// NewInstanceOf node constuctor func NewInstanceOf(Expr node.Node, Class node.Node) *InstanceOf { return &InstanceOf{ Expr, @@ -16,10 +18,13 @@ func NewInstanceOf(Expr node.Node, Class node.Node) *InstanceOf { } } +// Attributes returns node attributes as map func (n *InstanceOf) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *InstanceOf) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/isset.go b/node/expr/isset.go index 9136a2f..2efca83 100644 --- a/node/expr/isset.go +++ b/node/expr/isset.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Isset node type Isset struct { Variables []node.Node } +// NewIsset node constuctor func NewIsset(Variables []node.Node) *Isset { return &Isset{ Variables, } } +// Attributes returns node attributes as map func (n *Isset) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Isset) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/list.go b/node/expr/list.go index 69aaf3c..f7e17c0 100644 --- a/node/expr/list.go +++ b/node/expr/list.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// List node type List struct { Items []node.Node } +// NewList node constuctor func NewList(Items []node.Node) *List { return &List{ Items, } } +// Attributes returns node attributes as map func (n *List) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *List) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/method_call.go b/node/expr/method_call.go index 8c6f88b..3bd8104 100644 --- a/node/expr/method_call.go +++ b/node/expr/method_call.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// MethodCall node type MethodCall struct { Variable node.Node Method node.Node Arguments []node.Node } +// NewMethodCall node constuctor func NewMethodCall(Variable node.Node, Method node.Node, Arguments []node.Node) *MethodCall { return &MethodCall{ Variable, @@ -18,10 +20,13 @@ func NewMethodCall(Variable node.Node, Method node.Node, Arguments []node.Node) } } +// Attributes returns node attributes as map func (n *MethodCall) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *MethodCall) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/new.go b/node/expr/new.go index cfebdea..3c47b32 100644 --- a/node/expr/new.go +++ b/node/expr/new.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// New node type New struct { Class node.Node Arguments []node.Node } +// NewNew node constuctor func NewNew(Class node.Node, Arguments []node.Node) *New { return &New{ Class, @@ -16,10 +18,13 @@ func NewNew(Class node.Node, Arguments []node.Node) *New { } } +// Attributes returns node attributes as map func (n *New) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *New) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/post_dec.go b/node/expr/post_dec.go index 3620a80..478c496 100644 --- a/node/expr/post_dec.go +++ b/node/expr/post_dec.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// PostDec node type PostDec struct { Variable node.Node } +// NewPostDec node constuctor func NewPostDec(Variable node.Node) *PostDec { return &PostDec{ Variable, } } +// Attributes returns node attributes as map func (n *PostDec) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *PostDec) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/post_inc.go b/node/expr/post_inc.go index 5bf39f7..e6448c5 100644 --- a/node/expr/post_inc.go +++ b/node/expr/post_inc.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// PostInc node type PostInc struct { Variable node.Node } +// NewPostInc node constuctor func NewPostInc(Variable node.Node) *PostInc { return &PostInc{ Variable, } } +// Attributes returns node attributes as map func (n *PostInc) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *PostInc) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/pre_dec.go b/node/expr/pre_dec.go index aa8a513..20bd7cf 100644 --- a/node/expr/pre_dec.go +++ b/node/expr/pre_dec.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// PreDec node type PreDec struct { Variable node.Node } +// NewPreDec node constuctor func NewPreDec(Variable node.Node) *PreDec { return &PreDec{ Variable, } } +// Attributes returns node attributes as map func (n *PreDec) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *PreDec) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/pre_inc.go b/node/expr/pre_inc.go index cdacf2e..cea917d 100644 --- a/node/expr/pre_inc.go +++ b/node/expr/pre_inc.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// PreInc node type PreInc struct { Variable node.Node } +// NewPreInc node constuctor func NewPreInc(Variable node.Node) *PreInc { return &PreInc{ Variable, } } +// Attributes returns node attributes as map func (n *PreInc) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *PreInc) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/print.go b/node/expr/print.go index b363e31..0649f7f 100644 --- a/node/expr/print.go +++ b/node/expr/print.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Print node type Print struct { Expr node.Node } +// NewPrint node constuctor func NewPrint(Expression node.Node) *Print { return &Print{ Expression, } } +// Attributes returns node attributes as map func (n *Print) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Print) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/property_fetch.go b/node/expr/property_fetch.go index 0861f8e..f23984a 100644 --- a/node/expr/property_fetch.go +++ b/node/expr/property_fetch.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// PropertyFetch node type PropertyFetch struct { Variable node.Node Property node.Node } +// NewPropertyFetch node constuctor func NewPropertyFetch(Variable node.Node, Property node.Node) *PropertyFetch { return &PropertyFetch{ Variable, @@ -16,10 +18,13 @@ func NewPropertyFetch(Variable node.Node, Property node.Node) *PropertyFetch { } } +// Attributes returns node attributes as map func (n *PropertyFetch) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *PropertyFetch) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/require.go b/node/expr/require.go index 6ee1792..105b12e 100644 --- a/node/expr/require.go +++ b/node/expr/require.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Require node type Require struct { Expr node.Node } +// NewRequire node constuctor func NewRequire(Expression node.Node) *Require { return &Require{ Expression, } } +// Attributes returns node attributes as map func (n *Require) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Require) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/require_once.go b/node/expr/require_once.go index 86e9ffe..ef409b0 100644 --- a/node/expr/require_once.go +++ b/node/expr/require_once.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// RequireOnce node type RequireOnce struct { Expr node.Node } +// NewRequireOnce node constuctor func NewRequireOnce(Expression node.Node) *RequireOnce { return &RequireOnce{ Expression, } } +// Attributes returns node attributes as map func (n *RequireOnce) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *RequireOnce) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/shell_exec.go b/node/expr/shell_exec.go index 95de24e..fc0913e 100644 --- a/node/expr/shell_exec.go +++ b/node/expr/shell_exec.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ShellExec node type ShellExec struct { Parts []node.Node } +// NewShellExec node constuctor func NewShellExec(Parts []node.Node) *ShellExec { return &ShellExec{ Parts, } } +// Attributes returns node attributes as map func (n *ShellExec) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ShellExec) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/short_array.go b/node/expr/short_array.go index 921d62c..55dfe08 100644 --- a/node/expr/short_array.go +++ b/node/expr/short_array.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ShortArray node type ShortArray struct { Items []node.Node } +// NewShortArray node constuctor func NewShortArray(Items []node.Node) *ShortArray { return &ShortArray{ Items, } } +// Attributes returns node attributes as map func (n *ShortArray) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ShortArray) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/short_list.go b/node/expr/short_list.go index 0b1638d..0da0823 100644 --- a/node/expr/short_list.go +++ b/node/expr/short_list.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ShortList node type ShortList struct { Items []node.Node } +// NewShortList node constuctor func NewShortList(Items []node.Node) *ShortList { return &ShortList{ Items, } } +// Attributes returns node attributes as map func (n *ShortList) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ShortList) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/static_call.go b/node/expr/static_call.go index 09de598..fa50a7a 100644 --- a/node/expr/static_call.go +++ b/node/expr/static_call.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// StaticCall node type StaticCall struct { Class node.Node Call node.Node Arguments []node.Node } +// NewStaticCall node constuctor func NewStaticCall(Class node.Node, Call node.Node, Arguments []node.Node) *StaticCall { return &StaticCall{ Class, @@ -18,10 +20,13 @@ func NewStaticCall(Class node.Node, Call node.Node, Arguments []node.Node) *Stat } } +// Attributes returns node attributes as map func (n *StaticCall) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *StaticCall) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/static_property_fetch.go b/node/expr/static_property_fetch.go index c55990c..9dfcd0f 100644 --- a/node/expr/static_property_fetch.go +++ b/node/expr/static_property_fetch.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// StaticPropertyFetch node type StaticPropertyFetch struct { Class node.Node Property node.Node } +// NewStaticPropertyFetch node constuctor func NewStaticPropertyFetch(Class node.Node, Property node.Node) *StaticPropertyFetch { return &StaticPropertyFetch{ Class, @@ -16,10 +18,13 @@ func NewStaticPropertyFetch(Class node.Node, Property node.Node) *StaticProperty } } +// Attributes returns node attributes as map func (n *StaticPropertyFetch) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *StaticPropertyFetch) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/ternary.go b/node/expr/ternary.go index 7e1aa87..89cd2c4 100644 --- a/node/expr/ternary.go +++ b/node/expr/ternary.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Ternary node type Ternary struct { Condition node.Node IfTrue node.Node IfFalse node.Node } +// NewTernary node constuctor func NewTernary(Condition node.Node, IfTrue node.Node, IfFalse node.Node) *Ternary { return &Ternary{ Condition, @@ -18,10 +20,13 @@ func NewTernary(Condition node.Node, IfTrue node.Node, IfFalse node.Node) *Terna } } +// Attributes returns node attributes as map func (n *Ternary) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Ternary) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/unary_minus.go b/node/expr/unary_minus.go index 3f4e66f..2cb42dd 100644 --- a/node/expr/unary_minus.go +++ b/node/expr/unary_minus.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// UnaryMinus node type UnaryMinus struct { Expr node.Node } +// NewUnaryMinus node constuctor func NewUnaryMinus(Expression node.Node) *UnaryMinus { return &UnaryMinus{ Expression, } } +// Attributes returns node attributes as map func (n *UnaryMinus) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *UnaryMinus) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/unary_plus.go b/node/expr/unary_plus.go index 72b06f5..e0263ad 100644 --- a/node/expr/unary_plus.go +++ b/node/expr/unary_plus.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// UnaryPlus node type UnaryPlus struct { Expr node.Node } +// NewUnaryPlus node constuctor func NewUnaryPlus(Expression node.Node) *UnaryPlus { return &UnaryPlus{ Expression, } } +// Attributes returns node attributes as map func (n *UnaryPlus) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *UnaryPlus) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/variable.go b/node/expr/variable.go index fbcb014..4e4b58d 100644 --- a/node/expr/variable.go +++ b/node/expr/variable.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Variable node type Variable struct { VarName node.Node } +// NewVariable node constuctor func NewVariable(VarName node.Node) *Variable { return &Variable{ VarName, } } +// Attributes returns node attributes as map func (n *Variable) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Variable) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/yield.go b/node/expr/yield.go index 40aea01..e9ef29e 100644 --- a/node/expr/yield.go +++ b/node/expr/yield.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Yield node type Yield struct { Key node.Node Value node.Node } +// NewYield node constuctor func NewYield(Key node.Node, Value node.Node) *Yield { return &Yield{ Key, @@ -16,10 +18,13 @@ func NewYield(Key node.Node, Value node.Node) *Yield { } } +// Attributes returns node attributes as map func (n *Yield) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Yield) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/expr/yield_from.go b/node/expr/yield_from.go index 473855d..7036345 100644 --- a/node/expr/yield_from.go +++ b/node/expr/yield_from.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// YieldFrom node type YieldFrom struct { Expr node.Node } +// NewYieldFrom node constuctor func NewYieldFrom(Expression node.Node) *YieldFrom { return &YieldFrom{ Expression, } } +// Attributes returns node attributes as map func (n *YieldFrom) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *YieldFrom) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/identifier.go b/node/identifier.go index d6e518f..8458b7a 100644 --- a/node/identifier.go +++ b/node/identifier.go @@ -1,21 +1,26 @@ package node +// Identifier node type Identifier struct { Value string } +// NewIdentifier node constuctor func NewIdentifier(Value string) *Identifier { return &Identifier{ Value, } } +// Attributes returns node attributes as map func (n *Identifier) Attributes() map[string]interface{} { return map[string]interface{}{ "Value": n.Value, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Identifier) Walk(v Visitor) { if v.EnterNode(n) == false { return diff --git a/node/name/fully_qualified.go b/node/name/fully_qualified.go index 9d7757d..4f95f2b 100644 --- a/node/name/fully_qualified.go +++ b/node/name/fully_qualified.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// FullyQualified node type FullyQualified struct { Name } +// NewFullyQualified node constuctor func NewFullyQualified(Parts []node.Node) *FullyQualified { return &FullyQualified{ Name{ diff --git a/node/name/name.go b/node/name/name.go index ee2caf2..d04f9d7 100644 --- a/node/name/name.go +++ b/node/name/name.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Name node type Name struct { Parts []node.Node } +// NewName node constuctor func NewName(Parts []node.Node) *Name { return &Name{ Parts, } } +// Attributes returns node attributes as map func (n *Name) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Name) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/name/name_part.go b/node/name/name_part.go index 9564de2..4609289 100644 --- a/node/name/name_part.go +++ b/node/name/name_part.go @@ -4,22 +4,27 @@ import ( "github.com/z7zmey/php-parser/node" ) +// NamePart node type NamePart struct { Value string } +// NewNamePart node constuctor func NewNamePart(Value string) *NamePart { return &NamePart{ Value, } } +// Attributes returns node attributes as map func (n *NamePart) Attributes() map[string]interface{} { return map[string]interface{}{ "Value": n.Value, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *NamePart) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/name/relative.go b/node/name/relative.go index c16f023..4c11deb 100644 --- a/node/name/relative.go +++ b/node/name/relative.go @@ -4,10 +4,12 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Relative node type Relative struct { Name } +// NewRelative node constuctor func NewRelative(Parts []node.Node) *Relative { return &Relative{ Name{ diff --git a/node/node.go b/node/node.go index 8724ed1..96be26e 100644 --- a/node/node.go +++ b/node/node.go @@ -2,6 +2,7 @@ package node import "fmt" +// Node interface type Node interface { Attributes() map[string]interface{} Walk(v Visitor) diff --git a/node/nullable.go b/node/nullable.go index 6f96aad..70fe2e3 100644 --- a/node/nullable.go +++ b/node/nullable.go @@ -1,19 +1,24 @@ package node +// Nullable node type Nullable struct { Expr Node } +// NewNullable node constuctor func NewNullable(Expression Node) *Nullable { return &Nullable{ Expression, } } +// Attributes returns node attributes as map func (n *Nullable) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Nullable) Walk(v Visitor) { if v.EnterNode(n) == false { return diff --git a/node/parameter.go b/node/parameter.go index 7267d48..ce6c82e 100644 --- a/node/parameter.go +++ b/node/parameter.go @@ -1,5 +1,6 @@ package node +// Parameter node type Parameter struct { ByRef bool Variadic bool @@ -8,6 +9,7 @@ type Parameter struct { DefaultValue Node } +// NewParameter node constuctor func NewParameter(VariableType Node, Variable Node, DefaultValue Node, ByRef bool, Variadic bool) *Parameter { return &Parameter{ ByRef, @@ -18,6 +20,7 @@ func NewParameter(VariableType Node, Variable Node, DefaultValue Node, ByRef boo } } +// Attributes returns node attributes as map func (n *Parameter) Attributes() map[string]interface{} { return map[string]interface{}{ "ByRef": n.ByRef, @@ -25,6 +28,8 @@ func (n *Parameter) Attributes() map[string]interface{} { } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Parameter) Walk(v Visitor) { if v.EnterNode(n) == false { return diff --git a/node/scalar/dnumber.go b/node/scalar/dnumber.go index 20e3b43..4e009f6 100644 --- a/node/scalar/dnumber.go +++ b/node/scalar/dnumber.go @@ -4,22 +4,27 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Dnumber node type Dnumber struct { Value string } +// NewDnumber node constuctor func NewDnumber(Value string) *Dnumber { return &Dnumber{ Value, } } +// Attributes returns node attributes as map func (n *Dnumber) Attributes() map[string]interface{} { return map[string]interface{}{ "Value": n.Value, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Dnumber) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/scalar/encapsed.go b/node/scalar/encapsed.go index 94eac18..6243447 100644 --- a/node/scalar/encapsed.go +++ b/node/scalar/encapsed.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Encapsed node type Encapsed struct { Parts []node.Node } +// NewEncapsed node constuctor func NewEncapsed(Parts []node.Node) *Encapsed { return &Encapsed{ Parts, } } +// Attributes returns node attributes as map func (n *Encapsed) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Encapsed) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/scalar/encapsed_string_part.go b/node/scalar/encapsed_string_part.go index dd39648..32b49cf 100644 --- a/node/scalar/encapsed_string_part.go +++ b/node/scalar/encapsed_string_part.go @@ -4,22 +4,27 @@ import ( "github.com/z7zmey/php-parser/node" ) +// EncapsedStringPart node type EncapsedStringPart struct { Value string } +// NewEncapsedStringPart node constuctor func NewEncapsedStringPart(Value string) *EncapsedStringPart { return &EncapsedStringPart{ Value, } } +// Attributes returns node attributes as map func (n *EncapsedStringPart) Attributes() map[string]interface{} { return map[string]interface{}{ "Value": n.Value, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *EncapsedStringPart) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/scalar/lnumber.go b/node/scalar/lnumber.go index 2e9f225..3205572 100644 --- a/node/scalar/lnumber.go +++ b/node/scalar/lnumber.go @@ -4,22 +4,27 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Lnumber node type Lnumber struct { Value string } +// NewLnumber node constuctor func NewLnumber(Value string) *Lnumber { return &Lnumber{ Value, } } +// Attributes returns node attributes as map func (n *Lnumber) Attributes() map[string]interface{} { return map[string]interface{}{ "Value": n.Value, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Lnumber) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/scalar/magic_constant.go b/node/scalar/magic_constant.go index 58dd002..93e5530 100644 --- a/node/scalar/magic_constant.go +++ b/node/scalar/magic_constant.go @@ -4,22 +4,27 @@ import ( "github.com/z7zmey/php-parser/node" ) +// MagicConstant node type MagicConstant struct { Value string } +// NewMagicConstant node constuctor func NewMagicConstant(Value string) *MagicConstant { return &MagicConstant{ Value, } } +// Attributes returns node attributes as map func (n *MagicConstant) Attributes() map[string]interface{} { return map[string]interface{}{ "Value": n.Value, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *MagicConstant) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/scalar/string.go b/node/scalar/string.go index eeb8777..cea5d10 100644 --- a/node/scalar/string.go +++ b/node/scalar/string.go @@ -4,22 +4,27 @@ import ( "github.com/z7zmey/php-parser/node" ) +// String node type String struct { Value string } +// NewString node constuctor func NewString(Value string) *String { return &String{ Value, } } +// Attributes returns node attributes as map func (n *String) Attributes() map[string]interface{} { return map[string]interface{}{ "Value": n.Value, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *String) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/alt_else.go b/node/stmt/alt_else.go index d57a4a7..213d3dd 100644 --- a/node/stmt/alt_else.go +++ b/node/stmt/alt_else.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// AltElse node type AltElse struct { Stmt node.Node } +// NewAltElse node constuctor func NewAltElse(Stmt node.Node) *AltElse { return &AltElse{ Stmt, } } +// Attributes returns node attributes as map func (n *AltElse) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *AltElse) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/alt_else_if.go b/node/stmt/alt_else_if.go index 74ead78..870b82a 100644 --- a/node/stmt/alt_else_if.go +++ b/node/stmt/alt_else_if.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// AltElseIf node type AltElseIf struct { Cond node.Node Stmt node.Node } +// NewAltElseIf node constuctor func NewAltElseIf(Cond node.Node, Stmt node.Node) *AltElseIf { return &AltElseIf{ Cond, @@ -16,10 +18,13 @@ func NewAltElseIf(Cond node.Node, Stmt node.Node) *AltElseIf { } } +// Attributes returns node attributes as map func (n *AltElseIf) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *AltElseIf) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/alt_if.go b/node/stmt/alt_if.go index a5182cd..e5557f2 100644 --- a/node/stmt/alt_if.go +++ b/node/stmt/alt_if.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// AltIf node type AltIf struct { Cond node.Node Stmt node.Node @@ -11,6 +12,7 @@ type AltIf struct { _else node.Node } +// NewAltIf node constuctor func NewAltIf(Cond node.Node, Stmt node.Node) *AltIf { return &AltIf{ Cond, @@ -20,6 +22,7 @@ func NewAltIf(Cond node.Node, Stmt node.Node) *AltIf { } } +// Attributes returns node attributes as map func (n *AltIf) Attributes() map[string]interface{} { return nil } @@ -40,6 +43,8 @@ func (n *AltIf) SetElse(_else node.Node) node.Node { return n } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *AltIf) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/break.go b/node/stmt/break.go index 18fa7f5..8754d4f 100644 --- a/node/stmt/break.go +++ b/node/stmt/break.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Break node type Break struct { Expr node.Node } +// NewBreak node constuctor func NewBreak(Expr node.Node) *Break { return &Break{ Expr, } } +// Attributes returns node attributes as map func (n *Break) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Break) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/case.go b/node/stmt/case.go index a5c225c..ec8acd0 100644 --- a/node/stmt/case.go +++ b/node/stmt/case.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Case node type Case struct { Cond node.Node Stmts []node.Node } +// NewCase node constuctor func NewCase(Cond node.Node, Stmts []node.Node) *Case { return &Case{ Cond, @@ -16,10 +18,13 @@ func NewCase(Cond node.Node, Stmts []node.Node) *Case { } } +// Attributes returns node attributes as map func (n *Case) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Case) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/catch.go b/node/stmt/catch.go index 7b76908..7b7d08c 100644 --- a/node/stmt/catch.go +++ b/node/stmt/catch.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Catch node type Catch struct { Types []node.Node Variable node.Node Stmts []node.Node } +// NewCatch node constuctor func NewCatch(Types []node.Node, Variable node.Node, Stmts []node.Node) *Catch { return &Catch{ Types, @@ -18,10 +20,13 @@ func NewCatch(Types []node.Node, Variable node.Node, Stmts []node.Node) *Catch { } } +// Attributes returns node attributes as map func (n *Catch) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Catch) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/class.go b/node/stmt/class.go index 23b3395..58a0e27 100644 --- a/node/stmt/class.go +++ b/node/stmt/class.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Class node type Class struct { PhpDocComment string ClassName node.Node @@ -14,6 +15,7 @@ type Class struct { Stmts []node.Node } +// NewClass node constuctor func NewClass(ClassName node.Node, Modifiers []node.Node, args []node.Node, Extends node.Node, Implements []node.Node, Stmts []node.Node, PhpDocComment string) *Class { return &Class{ PhpDocComment, @@ -26,12 +28,15 @@ func NewClass(ClassName node.Node, Modifiers []node.Node, args []node.Node, Exte } } +// Attributes returns node attributes as map func (n *Class) Attributes() map[string]interface{} { return map[string]interface{}{ "PhpDocComment": n.PhpDocComment, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Class) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/class_const_list.go b/node/stmt/class_const_list.go index 852c5d0..cd80310 100644 --- a/node/stmt/class_const_list.go +++ b/node/stmt/class_const_list.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ClassConstList node type ClassConstList struct { Modifiers []node.Node Consts []node.Node } +// NewClassConstList node constuctor func NewClassConstList(Modifiers []node.Node, Consts []node.Node) *ClassConstList { return &ClassConstList{ Modifiers, @@ -16,10 +18,13 @@ func NewClassConstList(Modifiers []node.Node, Consts []node.Node) *ClassConstLis } } +// Attributes returns node attributes as map func (n *ClassConstList) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ClassConstList) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/class_method.go b/node/stmt/class_method.go index 71b4c86..b1306b8 100644 --- a/node/stmt/class_method.go +++ b/node/stmt/class_method.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ClassMethod node type ClassMethod struct { ReturnsRef bool PhpDocComment string @@ -14,6 +15,7 @@ type ClassMethod struct { Stmts []node.Node } +// NewClassMethod node constuctor func NewClassMethod(MethodName node.Node, Modifiers []node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) *ClassMethod { return &ClassMethod{ ReturnsRef, @@ -26,6 +28,7 @@ func NewClassMethod(MethodName node.Node, Modifiers []node.Node, ReturnsRef bool } } +// Attributes returns node attributes as map func (n *ClassMethod) Attributes() map[string]interface{} { return map[string]interface{}{ "ReturnsRef": n.ReturnsRef, @@ -33,6 +36,8 @@ func (n *ClassMethod) Attributes() map[string]interface{} { } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ClassMethod) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/const_list.go b/node/stmt/const_list.go index a3e4de0..7d09790 100644 --- a/node/stmt/const_list.go +++ b/node/stmt/const_list.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ConstList node type ConstList struct { Consts []node.Node } +// NewConstList node constuctor func NewConstList(Consts []node.Node) *ConstList { return &ConstList{ Consts, } } +// Attributes returns node attributes as map func (n *ConstList) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ConstList) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/constant.go b/node/stmt/constant.go index 33db687..dabcdcd 100644 --- a/node/stmt/constant.go +++ b/node/stmt/constant.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Constant node type Constant struct { PhpDocComment string ConstantName node.Node Expr node.Node } +// NewConstant node constuctor func NewConstant(ConstantName node.Node, Expr node.Node, PhpDocComment string) *Constant { return &Constant{ PhpDocComment, @@ -18,12 +20,15 @@ func NewConstant(ConstantName node.Node, Expr node.Node, PhpDocComment string) * } } +// Attributes returns node attributes as map func (n *Constant) Attributes() map[string]interface{} { return map[string]interface{}{ "PhpDocComment": n.PhpDocComment, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Constant) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/continue.go b/node/stmt/continue.go index 3c66239..3011ff1 100644 --- a/node/stmt/continue.go +++ b/node/stmt/continue.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Continue node type Continue struct { Expr node.Node } +// NewContinue node constuctor func NewContinue(Expr node.Node) *Continue { return &Continue{ Expr, } } +// Attributes returns node attributes as map func (n *Continue) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Continue) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/declare.go b/node/stmt/declare.go index 7fcfcf7..0a68aaf 100644 --- a/node/stmt/declare.go +++ b/node/stmt/declare.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Declare node type Declare struct { Consts []node.Node Stmt node.Node } +// NewDeclare node constuctor func NewDeclare(Consts []node.Node, Stmt node.Node) *Declare { return &Declare{ Consts, @@ -16,10 +18,13 @@ func NewDeclare(Consts []node.Node, Stmt node.Node) *Declare { } } +// Attributes returns node attributes as map func (n *Declare) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Declare) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/default.go b/node/stmt/default.go index bd6b07c..386b4de 100644 --- a/node/stmt/default.go +++ b/node/stmt/default.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Default node type Default struct { Stmts []node.Node } +// NewDefault node constuctor func NewDefault(Stmts []node.Node) *Default { return &Default{ Stmts, } } +// Attributes returns node attributes as map func (n *Default) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Default) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/do.go b/node/stmt/do.go index 6a6ec0a..2f8e714 100644 --- a/node/stmt/do.go +++ b/node/stmt/do.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Do node type Do struct { Stmt node.Node Cond node.Node } +// NewDo node constuctor func NewDo(Stmt node.Node, Cond node.Node) *Do { return &Do{ Stmt, @@ -16,10 +18,13 @@ func NewDo(Stmt node.Node, Cond node.Node) *Do { } } +// Attributes returns node attributes as map func (n *Do) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Do) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/echo.go b/node/stmt/echo.go index c5f355d..1357a9d 100644 --- a/node/stmt/echo.go +++ b/node/stmt/echo.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Echo node type Echo struct { Exprs []node.Node } +// NewEcho node constuctor func NewEcho(Exprs []node.Node) *Echo { return &Echo{ Exprs, } } +// Attributes returns node attributes as map func (n *Echo) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Echo) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/else.go b/node/stmt/else.go index 28f9e5b..bcaaf88 100644 --- a/node/stmt/else.go +++ b/node/stmt/else.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Else node type Else struct { Stmt node.Node } +// NewElse node constuctor func NewElse(Stmt node.Node) *Else { return &Else{ Stmt, } } +// Attributes returns node attributes as map func (n *Else) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Else) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/else_if.go b/node/stmt/else_if.go index b7a9489..9a77e9e 100644 --- a/node/stmt/else_if.go +++ b/node/stmt/else_if.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// ElseIf node type ElseIf struct { Cond node.Node Stmt node.Node } +// NewElseIf node constuctor func NewElseIf(Cond node.Node, Stmt node.Node) *ElseIf { return &ElseIf{ Cond, @@ -16,10 +18,13 @@ func NewElseIf(Cond node.Node, Stmt node.Node) *ElseIf { } } +// Attributes returns node attributes as map func (n *ElseIf) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *ElseIf) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/expression.go b/node/stmt/expression.go index 17f0800..41bd4de 100644 --- a/node/stmt/expression.go +++ b/node/stmt/expression.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Expression node type Expression struct { Expr node.Node } +// NewExpression node constuctor func NewExpression(Expr node.Node) *Expression { return &Expression{ Expr, } } +// Attributes returns node attributes as map func (n *Expression) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Expression) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/finally.go b/node/stmt/finally.go index 966e84f..692f096 100644 --- a/node/stmt/finally.go +++ b/node/stmt/finally.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Finally node type Finally struct { Stmts []node.Node } +// NewFinally node constuctor func NewFinally(Stmts []node.Node) *Finally { return &Finally{ Stmts, } } +// Attributes returns node attributes as map func (n *Finally) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Finally) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/for.go b/node/stmt/for.go index 1bb3da5..aa07b40 100644 --- a/node/stmt/for.go +++ b/node/stmt/for.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// For node type For struct { Init []node.Node Cond []node.Node @@ -11,6 +12,7 @@ type For struct { Stmt node.Node } +// NewFor node constuctor func NewFor(Init []node.Node, Cond []node.Node, Loop []node.Node, Stmt node.Node) *For { return &For{ Init, @@ -20,10 +22,13 @@ func NewFor(Init []node.Node, Cond []node.Node, Loop []node.Node, Stmt node.Node } } +// Attributes returns node attributes as map func (n *For) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *For) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/foreach.go b/node/stmt/foreach.go index 8cade46..389a497 100644 --- a/node/stmt/foreach.go +++ b/node/stmt/foreach.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Foreach node type Foreach struct { ByRef bool Expr node.Node @@ -12,6 +13,7 @@ type Foreach struct { Stmt node.Node } +// NewForeach node constuctor func NewForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Node, ByRef bool) *Foreach { return &Foreach{ ByRef, @@ -22,12 +24,15 @@ func NewForeach(Expr node.Node, Key node.Node, Variable node.Node, Stmt node.Nod } } +// Attributes returns node attributes as map func (n *Foreach) Attributes() map[string]interface{} { return map[string]interface{}{ "ByRef": n.ByRef, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Foreach) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/function.go b/node/stmt/function.go index 59f0881..396ae24 100644 --- a/node/stmt/function.go +++ b/node/stmt/function.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Function node type Function struct { ReturnsRef bool PhpDocComment string @@ -13,6 +14,7 @@ type Function struct { Stmts []node.Node } +// NewFunction node constuctor func NewFunction(FunctionName node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) *Function { return &Function{ ReturnsRef, @@ -24,6 +26,7 @@ func NewFunction(FunctionName node.Node, ReturnsRef bool, Params []node.Node, Re } } +// Attributes returns node attributes as map func (n *Function) Attributes() map[string]interface{} { // return n.attributes return map[string]interface{}{ @@ -32,6 +35,8 @@ func (n *Function) Attributes() map[string]interface{} { } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Function) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/global.go b/node/stmt/global.go index 8329927..22d91c9 100644 --- a/node/stmt/global.go +++ b/node/stmt/global.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Global node type Global struct { Vars []node.Node } +// NewGlobal node constuctor func NewGlobal(Vars []node.Node) *Global { return &Global{ Vars, } } +// Attributes returns node attributes as map func (n *Global) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Global) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/goto.go b/node/stmt/goto.go index f25f694..64c0620 100644 --- a/node/stmt/goto.go +++ b/node/stmt/goto.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Goto node type Goto struct { Label node.Node } +// NewGoto node constuctor func NewGoto(Label node.Node) *Goto { return &Goto{ Label, } } +// Attributes returns node attributes as map func (n *Goto) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Goto) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/group_use.go b/node/stmt/group_use.go index 947cfdc..0ff0961 100644 --- a/node/stmt/group_use.go +++ b/node/stmt/group_use.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// GroupUse node type GroupUse struct { UseType node.Node pRefix node.Node UseList []node.Node } +// NewGroupUse node constuctor func NewGroupUse(UseType node.Node, pRefix node.Node, UseList []node.Node) *GroupUse { return &GroupUse{ UseType, @@ -18,6 +20,7 @@ func NewGroupUse(UseType node.Node, pRefix node.Node, UseList []node.Node) *Grou } } +// Attributes returns node attributes as map func (n *GroupUse) Attributes() map[string]interface{} { return nil } @@ -27,6 +30,8 @@ func (n *GroupUse) SetUseType(UseType node.Node) node.Node { return n } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *GroupUse) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/halt_compiler.go b/node/stmt/halt_compiler.go index 96d1f36..74d4ded 100644 --- a/node/stmt/halt_compiler.go +++ b/node/stmt/halt_compiler.go @@ -4,17 +4,22 @@ import ( "github.com/z7zmey/php-parser/node" ) +// HaltCompiler node type HaltCompiler struct { } +// NewHaltCompiler node constuctor func NewHaltCompiler() *HaltCompiler { return &HaltCompiler{} } +// Attributes returns node attributes as map func (n *HaltCompiler) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *HaltCompiler) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/if.go b/node/stmt/if.go index c8f6c53..ff3a165 100644 --- a/node/stmt/if.go +++ b/node/stmt/if.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// If node type If struct { Cond node.Node Stmt node.Node @@ -11,6 +12,7 @@ type If struct { _else node.Node } +// NewIf node constuctor func NewIf(Cond node.Node, Stmt node.Node) *If { return &If{ Cond, @@ -20,6 +22,7 @@ func NewIf(Cond node.Node, Stmt node.Node) *If { } } +// Attributes returns node attributes as map func (n *If) Attributes() map[string]interface{} { return nil } @@ -40,6 +43,8 @@ func (n *If) SetElse(_else node.Node) node.Node { return n } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *If) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/inline_html.go b/node/stmt/inline_html.go index ce052c2..65ff3e6 100644 --- a/node/stmt/inline_html.go +++ b/node/stmt/inline_html.go @@ -4,22 +4,27 @@ import ( "github.com/z7zmey/php-parser/node" ) +// InlineHtml node type InlineHtml struct { Value string } +// NewInlineHtml node constuctor func NewInlineHtml(Value string) *InlineHtml { return &InlineHtml{ Value, } } +// Attributes returns node attributes as map func (n *InlineHtml) Attributes() map[string]interface{} { return map[string]interface{}{ "Value": n.Value, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *InlineHtml) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/interface.go b/node/stmt/interface.go index 109ae23..181dd19 100644 --- a/node/stmt/interface.go +++ b/node/stmt/interface.go @@ -4,6 +4,7 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Interface node type Interface struct { PhpDocComment string InterfaceName node.Node @@ -11,6 +12,7 @@ type Interface struct { Stmts []node.Node } +// NewInterface node constuctor func NewInterface(InterfaceName node.Node, Extends []node.Node, Stmts []node.Node, PhpDocComment string) *Interface { return &Interface{ PhpDocComment, @@ -20,12 +22,15 @@ func NewInterface(InterfaceName node.Node, Extends []node.Node, Stmts []node.Nod } } +// Attributes returns node attributes as map func (n *Interface) Attributes() map[string]interface{} { return map[string]interface{}{ "PhpDocComment": n.PhpDocComment, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Interface) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/label.go b/node/stmt/label.go index 01a1581..d1c5ad6 100644 --- a/node/stmt/label.go +++ b/node/stmt/label.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Label node type Label struct { LabelName node.Node } +// NewLabel node constuctor func NewLabel(LabelName node.Node) *Label { return &Label{ LabelName, } } +// Attributes returns node attributes as map func (n *Label) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Label) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/namespace.go b/node/stmt/namespace.go index 9ea357d..016b0ff 100644 --- a/node/stmt/namespace.go +++ b/node/stmt/namespace.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Namespace node type Namespace struct { NamespaceName node.Node Stmts []node.Node } +// NewNamespace node constuctor func NewNamespace(NamespaceName node.Node, Stmts []node.Node) *Namespace { return &Namespace{ NamespaceName, @@ -16,10 +18,13 @@ func NewNamespace(NamespaceName node.Node, Stmts []node.Node) *Namespace { } } +// Attributes returns node attributes as map func (n *Namespace) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Namespace) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/nop.go b/node/stmt/nop.go index e5e6b1f..6ad4116 100644 --- a/node/stmt/nop.go +++ b/node/stmt/nop.go @@ -4,17 +4,22 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Nop node type Nop struct { } +// NewNop node constuctor func NewNop() *Nop { return &Nop{} } +// Attributes returns node attributes as map func (n *Nop) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Nop) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/property.go b/node/stmt/property.go index 9206ac9..f2e81f0 100644 --- a/node/stmt/property.go +++ b/node/stmt/property.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Property node type Property struct { PhpDocComment string Variable node.Node Expr node.Node } +// NewProperty node constuctor func NewProperty(Variable node.Node, Expr node.Node, PhpDocComment string) *Property { return &Property{ PhpDocComment, @@ -17,12 +19,16 @@ func NewProperty(Variable node.Node, Expr node.Node, PhpDocComment string) *Prop Expr, } } + +// Attributes returns node attributes as map func (n *Property) Attributes() map[string]interface{} { return map[string]interface{}{ "PhpDocComment": n.PhpDocComment, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Property) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/property_list.go b/node/stmt/property_list.go index b2708c9..7711c95 100644 --- a/node/stmt/property_list.go +++ b/node/stmt/property_list.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// PropertyList node type PropertyList struct { Modifiers []node.Node Properties []node.Node } +// NewPropertyList node constuctor func NewPropertyList(Modifiers []node.Node, Properties []node.Node) *PropertyList { return &PropertyList{ Modifiers, @@ -16,10 +18,13 @@ func NewPropertyList(Modifiers []node.Node, Properties []node.Node) *PropertyLis } } +// Attributes returns node attributes as map func (n *PropertyList) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *PropertyList) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/return.go b/node/stmt/return.go index d53421e..4c0df9e 100644 --- a/node/stmt/return.go +++ b/node/stmt/return.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Return node type Return struct { Expr node.Node } +// NewReturn node constuctor func NewReturn(Expr node.Node) *Return { return &Return{ Expr, } } +// Attributes returns node attributes as map func (n *Return) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Return) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/static.go b/node/stmt/static.go index a70992f..5a55a6e 100644 --- a/node/stmt/static.go +++ b/node/stmt/static.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Static node type Static struct { Vars []node.Node } +// NewStatic node constuctor func NewStatic(Vars []node.Node) *Static { return &Static{ Vars, } } +// Attributes returns node attributes as map func (n *Static) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Static) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/static_var.go b/node/stmt/static_var.go index 1bc3ba3..aaf92ae 100644 --- a/node/stmt/static_var.go +++ b/node/stmt/static_var.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// StaticVar node type StaticVar struct { Variable node.Node Expr node.Node } +// NewStaticVar node constuctor func NewStaticVar(Variable node.Node, Expr node.Node) *StaticVar { return &StaticVar{ Variable, @@ -16,10 +18,13 @@ func NewStaticVar(Variable node.Node, Expr node.Node) *StaticVar { } } +// Attributes returns node attributes as map func (n *StaticVar) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *StaticVar) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/stmt_list.go b/node/stmt/stmt_list.go index 048346f..07be0e5 100644 --- a/node/stmt/stmt_list.go +++ b/node/stmt/stmt_list.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// StmtList node type StmtList struct { Stmts []node.Node } +// NewStmtList node constuctor func NewStmtList(Stmts []node.Node) *StmtList { return &StmtList{ Stmts, } } +// Attributes returns node attributes as map func (n *StmtList) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *StmtList) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/switch.go b/node/stmt/switch.go index 213f754..75b7874 100644 --- a/node/stmt/switch.go +++ b/node/stmt/switch.go @@ -5,12 +5,14 @@ import ( "github.com/z7zmey/php-parser/token" ) +// Switch node type Switch struct { token token.Token Cond node.Node cases []node.Node } +// NewSwitch node constuctor func NewSwitch(token token.Token, Cond node.Node, cases []node.Node) *Switch { return &Switch{ token, @@ -19,10 +21,13 @@ func NewSwitch(token token.Token, Cond node.Node, cases []node.Node) *Switch { } } +// Attributes returns node attributes as map func (n *Switch) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Switch) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/throw.go b/node/stmt/throw.go index ed822c0..d1750b1 100644 --- a/node/stmt/throw.go +++ b/node/stmt/throw.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Throw node type Throw struct { Expr node.Node } +// NewThrow node constuctor func NewThrow(Expr node.Node) *Throw { return &Throw{ Expr, } } +// Attributes returns node attributes as map func (n *Throw) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Throw) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/trait.go b/node/stmt/trait.go index c85d3db..367538e 100644 --- a/node/stmt/trait.go +++ b/node/stmt/trait.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Trait node type Trait struct { PhpDocComment string TraitName node.Node Stmts []node.Node } +// NewTrait node constuctor func NewTrait(TraitName node.Node, Stmts []node.Node, PhpDocComment string) *Trait { return &Trait{ PhpDocComment, @@ -18,12 +20,15 @@ func NewTrait(TraitName node.Node, Stmts []node.Node, PhpDocComment string) *Tra } } +// Attributes returns node attributes as map func (n *Trait) Attributes() map[string]interface{} { return map[string]interface{}{ "PhpDocComment": n.PhpDocComment, } } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Trait) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/trait_method_ref.go b/node/stmt/trait_method_ref.go index eda0c63..51e2c5c 100644 --- a/node/stmt/trait_method_ref.go +++ b/node/stmt/trait_method_ref.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// TraitMethodRef node type TraitMethodRef struct { Trait node.Node Method node.Node } +// NewTraitMethodRef node constuctor func NewTraitMethodRef(Trait node.Node, Method node.Node) *TraitMethodRef { return &TraitMethodRef{ Trait, @@ -16,10 +18,13 @@ func NewTraitMethodRef(Trait node.Node, Method node.Node) *TraitMethodRef { } } +// Attributes returns node attributes as map func (n *TraitMethodRef) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *TraitMethodRef) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/trait_use.go b/node/stmt/trait_use.go index d35dde2..886f2c4 100644 --- a/node/stmt/trait_use.go +++ b/node/stmt/trait_use.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// TraitUse node type TraitUse struct { Traits []node.Node Adaptations []node.Node } +// NewTraitUse node constuctor func NewTraitUse(Traits []node.Node, Adaptations []node.Node) *TraitUse { return &TraitUse{ Traits, @@ -16,10 +18,13 @@ func NewTraitUse(Traits []node.Node, Adaptations []node.Node) *TraitUse { } } +// Attributes returns node attributes as map func (n *TraitUse) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *TraitUse) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/trait_use_alias.go b/node/stmt/trait_use_alias.go index 334fad0..f43b58a 100644 --- a/node/stmt/trait_use_alias.go +++ b/node/stmt/trait_use_alias.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// TraitUseAlias node type TraitUseAlias struct { Ref node.Node Modifier node.Node Alias node.Node } +// NewTraitUseAlias node constuctor func NewTraitUseAlias(Ref node.Node, Modifier node.Node, Alias node.Node) *TraitUseAlias { return &TraitUseAlias{ Ref, @@ -18,10 +20,13 @@ func NewTraitUseAlias(Ref node.Node, Modifier node.Node, Alias node.Node) *Trait } } +// Attributes returns node attributes as map func (n *TraitUseAlias) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *TraitUseAlias) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/trait_use_precedence.go b/node/stmt/trait_use_precedence.go index 963b5fc..5f1a643 100644 --- a/node/stmt/trait_use_precedence.go +++ b/node/stmt/trait_use_precedence.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// TraitUsePrecedence node type TraitUsePrecedence struct { Ref node.Node Insteadof node.Node } +// NewTraitUsePrecedence node constuctor func NewTraitUsePrecedence(Ref node.Node, Insteadof node.Node) *TraitUsePrecedence { return &TraitUsePrecedence{ Ref, @@ -16,10 +18,13 @@ func NewTraitUsePrecedence(Ref node.Node, Insteadof node.Node) *TraitUsePreceden } } +// Attributes returns node attributes as map func (n *TraitUsePrecedence) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *TraitUsePrecedence) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/try.go b/node/stmt/try.go index b216e5d..1c65059 100644 --- a/node/stmt/try.go +++ b/node/stmt/try.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Try node type Try struct { Stmts []node.Node Catches []node.Node Finally node.Node } +// NewTry node constuctor func NewTry(Stmts []node.Node, Catches []node.Node, Finally node.Node) *Try { return &Try{ Stmts, @@ -18,10 +20,13 @@ func NewTry(Stmts []node.Node, Catches []node.Node, Finally node.Node) *Try { } } +// Attributes returns node attributes as map func (n *Try) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Try) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/unset.go b/node/stmt/unset.go index 3b8bdc1..887e9c1 100644 --- a/node/stmt/unset.go +++ b/node/stmt/unset.go @@ -4,20 +4,25 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Unset node type Unset struct { Vars []node.Node } +// NewUnset node constuctor func NewUnset(Vars []node.Node) *Unset { return &Unset{ Vars, } } +// Attributes returns node attributes as map func (n *Unset) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Unset) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/use.go b/node/stmt/use.go index f1377d7..b53e249 100644 --- a/node/stmt/use.go +++ b/node/stmt/use.go @@ -4,12 +4,14 @@ import ( "github.com/z7zmey/php-parser/node" ) +// Use node type Use struct { UseType node.Node Use node.Node Alias node.Node } +// NewUse node constuctor func NewUse(UseType node.Node, use node.Node, Alias node.Node) *Use { return &Use{ UseType, @@ -18,6 +20,7 @@ func NewUse(UseType node.Node, use node.Node, Alias node.Node) *Use { } } +// Attributes returns node attributes as map func (n *Use) Attributes() map[string]interface{} { return nil } @@ -27,6 +30,8 @@ func (n *Use) SetUseType(UseType node.Node) node.Node { return n } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *Use) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/use_list.go b/node/stmt/use_list.go index 1413371..332cac1 100644 --- a/node/stmt/use_list.go +++ b/node/stmt/use_list.go @@ -4,11 +4,13 @@ import ( "github.com/z7zmey/php-parser/node" ) +// UseList node type UseList struct { UseType node.Node Uses []node.Node } +// NewUseList node constuctor func NewUseList(UseType node.Node, Uses []node.Node) *UseList { return &UseList{ UseType, @@ -16,10 +18,13 @@ func NewUseList(UseType node.Node, Uses []node.Node) *UseList { } } +// Attributes returns node attributes as map func (n *UseList) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *UseList) Walk(v node.Visitor) { if v.EnterNode(n) == false { return diff --git a/node/stmt/while.go b/node/stmt/while.go index 93e2a0a..4627f16 100644 --- a/node/stmt/while.go +++ b/node/stmt/while.go @@ -5,12 +5,14 @@ import ( "github.com/z7zmey/php-parser/token" ) +// While node type While struct { Token token.Token Cond node.Node Stmt node.Node } +// NewWhile node constuctor func NewWhile(Token token.Token, Cond node.Node, Stmt node.Node) *While { return &While{ Token, @@ -19,10 +21,13 @@ func NewWhile(Token token.Token, Cond node.Node, Stmt node.Node) *While { } } +// Attributes returns node attributes as map func (n *While) Attributes() map[string]interface{} { return nil } +// Walk traverses nodes +// Walk is invoked recursively until v.EnterNode returns true func (n *While) Walk(v node.Visitor) { if v.EnterNode(n) == false { return