add comments

This commit is contained in:
z7zmey 2018-01-11 19:33:25 +02:00
parent 0676e0cb5a
commit e814483f37
158 changed files with 771 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -4,6 +4,7 @@ import (
"github.com/z7zmey/php-parser/node"
)
// AssignOp node
type AssignOp struct {
Variable node.Node
Expression node.Node

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -4,6 +4,7 @@ import (
"github.com/z7zmey/php-parser/node"
)
// BinaryOp node
type BinaryOp struct {
Left node.Node
Right node.Node

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -4,6 +4,7 @@ import (
"github.com/z7zmey/php-parser/node"
)
// Cast node
type Cast struct {
Expr node.Node
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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{

View File

@ -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

View File

@ -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

View File

@ -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{

View File

@ -2,6 +2,7 @@ package node
import "fmt"
// Node interface
type Node interface {
Attributes() map[string]interface{}
Walk(v Visitor)

View File

@ -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

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