vendor: commit github.com/z7zmey/php-parser v0.7.0 (MIT license)

This commit is contained in:
mappu 2020-04-05 16:36:06 +12:00
parent 872c878857
commit c89f3232ae
200 changed files with 68367 additions and 0 deletions

21
vendor/github.com/z7zmey/php-parser/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Slizov Vadim
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

30
vendor/github.com/z7zmey/php-parser/errors/error.go generated vendored Normal file
View File

@ -0,0 +1,30 @@
package errors
import (
"fmt"
"github.com/z7zmey/php-parser/position"
)
// Error parsing error
type Error struct {
Msg string
Pos *position.Position
}
// NewError creates and returns new Error
func NewError(msg string, p *position.Position) *Error {
return &Error{
Msg: msg,
Pos: p,
}
}
func (e *Error) String() string {
atLine := ""
if e.Pos != nil {
atLine = fmt.Sprintf(" at line %d", e.Pos.StartLine)
}
return fmt.Sprintf("%s%s", e.Msg, atLine)
}

View File

@ -0,0 +1,98 @@
// Code generated by "stringer -type=Position -output ./position_string.go"; DO NOT EDIT.
package freefloating
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Start-0]
_ = x[End-1]
_ = x[Slash-2]
_ = x[Colon-3]
_ = x[SemiColon-4]
_ = x[AltEnd-5]
_ = x[Dollar-6]
_ = x[Ampersand-7]
_ = x[Name-8]
_ = x[Prefix-9]
_ = x[Key-10]
_ = x[Var-11]
_ = x[UseType-12]
_ = x[ReturnType-13]
_ = x[OptionalType-14]
_ = x[CaseSeparator-15]
_ = x[LexicalVars-16]
_ = x[Params-17]
_ = x[Ref-18]
_ = x[Cast-19]
_ = x[Expr-20]
_ = x[InitExpr-21]
_ = x[CondExpr-22]
_ = x[IncExpr-23]
_ = x[True-24]
_ = x[Cond-25]
_ = x[HaltCompiller-26]
_ = x[Namespace-27]
_ = x[Static-28]
_ = x[Class-29]
_ = x[Use-30]
_ = x[While-31]
_ = x[For-32]
_ = x[Switch-33]
_ = x[Break-34]
_ = x[Foreach-35]
_ = x[Declare-36]
_ = x[Label-37]
_ = x[Finally-38]
_ = x[List-39]
_ = x[Default-40]
_ = x[If-41]
_ = x[ElseIf-42]
_ = x[Else-43]
_ = x[Variadic-44]
_ = x[Function-45]
_ = x[DoubleArrow-46]
_ = x[Alias-47]
_ = x[As-48]
_ = x[Equal-49]
_ = x[Exit-50]
_ = x[Array-51]
_ = x[Isset-52]
_ = x[Empty-53]
_ = x[Eval-54]
_ = x[Echo-55]
_ = x[Try-56]
_ = x[Catch-57]
_ = x[Unset-58]
_ = x[Stmts-59]
_ = x[VarList-60]
_ = x[ConstList-61]
_ = x[NameList-62]
_ = x[ParamList-63]
_ = x[ModifierList-64]
_ = x[ArrayPairList-65]
_ = x[CaseListStart-66]
_ = x[CaseListEnd-67]
_ = x[ArgumentList-68]
_ = x[PropertyList-69]
_ = x[ParameterList-70]
_ = x[AdaptationList-71]
_ = x[LexicalVarList-72]
_ = x[UseDeclarationList-73]
_ = x[OpenParenthesisToken-74]
_ = x[CloseParenthesisToken-75]
}
const _Position_name = "StartEndSlashColonSemiColonAltEndDollarAmpersandNamePrefixKeyVarUseTypeReturnTypeOptionalTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchBreakForeachDeclareLabelFinallyListDefaultIfElseIfElseVariadicFunctionDoubleArrowAliasAsEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListUseDeclarationListOpenParenthesisTokenCloseParenthesisToken"
var _Position_index = [...]uint16{0, 5, 8, 13, 18, 27, 33, 39, 48, 52, 58, 61, 64, 71, 81, 93, 106, 117, 123, 126, 130, 134, 142, 150, 157, 161, 165, 178, 187, 193, 198, 201, 206, 209, 215, 220, 227, 234, 239, 246, 250, 257, 259, 265, 269, 277, 285, 296, 301, 303, 308, 312, 317, 322, 327, 331, 335, 338, 343, 348, 353, 360, 369, 377, 386, 398, 411, 424, 435, 447, 459, 472, 486, 500, 518, 538, 559}
func (i Position) String() string {
if i < 0 || i >= Position(len(_Position_index)-1) {
return "Position(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _Position_name[_Position_index[i]:_Position_index[i+1]]
}

View File

@ -0,0 +1,113 @@
package freefloating
import "github.com/z7zmey/php-parser/position"
type StringType int
const (
WhiteSpaceType StringType = iota
CommentType
TokenType
)
type Position int
//go:generate stringer -type=Position -output ./position_string.go
const (
Start Position = iota
End
Slash
Colon
SemiColon
AltEnd
Dollar
Ampersand
Name
Prefix
Key
Var
UseType
ReturnType
OptionalType
CaseSeparator
LexicalVars
Params
Ref
Cast
Expr
InitExpr
CondExpr
IncExpr
True
Cond
HaltCompiller
Namespace
Static
Class
Use
While
For
Switch
Break
Foreach
Declare
Label
Finally
List
Default
If
ElseIf
Else
Variadic
Function
DoubleArrow
Alias
As
Equal
Exit
Array
Isset
Empty
Eval
Echo
Try
Catch
Unset
Stmts
VarList
ConstList
NameList
ParamList
ModifierList
ArrayPairList
CaseListStart
CaseListEnd
ArgumentList
PropertyList
ParameterList
AdaptationList
LexicalVarList
UseDeclarationList
OpenParenthesisToken
CloseParenthesisToken
)
type String struct {
StringType StringType
Value string
Position *position.Position
}
type Collection map[Position][]String
func (c Collection) IsEmpty() bool {
for _, v := range c {
if len(v) > 0 {
return false
}
}
return true
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Assign node
type Assign struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewAssign node constructor
func NewAssign(Variable node.Node, Expression node.Node) *Assign {
return &Assign{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Assign) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Assign) GetPosition() *position.Position {
return n.Position
}
func (n *Assign) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Reference node
type Reference struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewReference node constructor
func NewReference(Variable node.Node, Expression node.Node) *Reference {
return &Reference{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Reference) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Reference) GetPosition() *position.Position {
return n.Position
}
func (n *Reference) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Reference) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Reference) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BitwiseAnd node
type BitwiseAnd struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewBitwiseAnd node constructor
func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd {
return &BitwiseAnd{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *BitwiseAnd) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BitwiseAnd) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseAnd) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BitwiseOr node
type BitwiseOr struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewBitwiseOr node constructor
func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr {
return &BitwiseOr{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *BitwiseOr) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BitwiseOr) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseOr) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BitwiseXor node
type BitwiseXor struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewBitwiseXor node constructor
func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor {
return &BitwiseXor{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *BitwiseXor) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BitwiseXor) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseXor) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Coalesce node
type Coalesce struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewCoalesce node constructor
func NewCoalesce(Variable node.Node, Expression node.Node) *Coalesce {
return &Coalesce{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Coalesce) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Coalesce) GetPosition() *position.Position {
return n.Position
}
func (n *Coalesce) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Concat node
type Concat struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewConcat node constructor
func NewConcat(Variable node.Node, Expression node.Node) *Concat {
return &Concat{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Concat) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Concat) GetPosition() *position.Position {
return n.Position
}
func (n *Concat) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Div node
type Div struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewDiv node constructor
func NewDiv(Variable node.Node, Expression node.Node) *Div {
return &Div{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Div) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Div) GetPosition() *position.Position {
return n.Position
}
func (n *Div) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Minus node
type Minus struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewMinus node constructor
func NewMinus(Variable node.Node, Expression node.Node) *Minus {
return &Minus{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Minus) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Minus) GetPosition() *position.Position {
return n.Position
}
func (n *Minus) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Mod node
type Mod struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewMod node constructor
func NewMod(Variable node.Node, Expression node.Node) *Mod {
return &Mod{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Mod) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Mod) GetPosition() *position.Position {
return n.Position
}
func (n *Mod) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Mul node
type Mul struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewMul node constructor
func NewMul(Variable node.Node, Expression node.Node) *Mul {
return &Mul{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Mul) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Mul) GetPosition() *position.Position {
return n.Position
}
func (n *Mul) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Plus node
type Plus struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewPlus node constructor
func NewPlus(Variable node.Node, Expression node.Node) *Plus {
return &Plus{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Plus) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Plus) GetPosition() *position.Position {
return n.Position
}
func (n *Plus) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Pow node
type Pow struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewPow node constructor
func NewPow(Variable node.Node, Expression node.Node) *Pow {
return &Pow{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *Pow) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Pow) GetPosition() *position.Position {
return n.Position
}
func (n *Pow) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ShiftLeft node
type ShiftLeft struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewShiftLeft node constructor
func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft {
return &ShiftLeft{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *ShiftLeft) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ShiftLeft) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftLeft) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package assign
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ShiftRight node
type ShiftRight struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Expression node.Node
}
// NewShiftRight node constructor
func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight {
return &ShiftRight{
FreeFloating: nil,
Variable: Variable,
Expression: Expression,
}
}
// SetPosition sets node position
func (n *ShiftRight) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ShiftRight) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftRight) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Expression != nil {
v.EnterChildNode("Expression", n)
n.Expression.Walk(v)
v.LeaveChildNode("Expression", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BitwiseAnd node
type BitwiseAnd struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewBitwiseAnd node constructor
func NewBitwiseAnd(Variable node.Node, Expression node.Node) *BitwiseAnd {
return &BitwiseAnd{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *BitwiseAnd) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BitwiseAnd) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseAnd) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BitwiseOr node
type BitwiseOr struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewBitwiseOr node constructor
func NewBitwiseOr(Variable node.Node, Expression node.Node) *BitwiseOr {
return &BitwiseOr{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *BitwiseOr) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BitwiseOr) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseOr) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BitwiseXor node
type BitwiseXor struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewBitwiseXor node constructor
func NewBitwiseXor(Variable node.Node, Expression node.Node) *BitwiseXor {
return &BitwiseXor{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *BitwiseXor) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BitwiseXor) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseXor) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BooleanAnd node
type BooleanAnd struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewBooleanAnd node constructor
func NewBooleanAnd(Variable node.Node, Expression node.Node) *BooleanAnd {
return &BooleanAnd{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *BooleanAnd) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BooleanAnd) GetPosition() *position.Position {
return n.Position
}
func (n *BooleanAnd) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BooleanOr node
type BooleanOr struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewBooleanOr node constructor
func NewBooleanOr(Variable node.Node, Expression node.Node) *BooleanOr {
return &BooleanOr{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *BooleanOr) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BooleanOr) GetPosition() *position.Position {
return n.Position
}
func (n *BooleanOr) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Coalesce node
type Coalesce struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewCoalesce node constructor
func NewCoalesce(Variable node.Node, Expression node.Node) *Coalesce {
return &Coalesce{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Coalesce) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Coalesce) GetPosition() *position.Position {
return n.Position
}
func (n *Coalesce) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Concat node
type Concat struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewConcat node constructor
func NewConcat(Variable node.Node, Expression node.Node) *Concat {
return &Concat{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Concat) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Concat) GetPosition() *position.Position {
return n.Position
}
func (n *Concat) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Div node
type Div struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewDiv node constructor
func NewDiv(Variable node.Node, Expression node.Node) *Div {
return &Div{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Div) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Div) GetPosition() *position.Position {
return n.Position
}
func (n *Div) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Equal node
type Equal struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewEqual node constructor
func NewEqual(Variable node.Node, Expression node.Node) *Equal {
return &Equal{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Equal) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Equal) GetPosition() *position.Position {
return n.Position
}
func (n *Equal) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Greater node
type Greater struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewGreater node constructor
func NewGreater(Variable node.Node, Expression node.Node) *Greater {
return &Greater{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Greater) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Greater) GetPosition() *position.Position {
return n.Position
}
func (n *Greater) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// GreaterOrEqual node
type GreaterOrEqual struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewGreaterOrEqual node constructor
func NewGreaterOrEqual(Variable node.Node, Expression node.Node) *GreaterOrEqual {
return &GreaterOrEqual{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *GreaterOrEqual) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *GreaterOrEqual) GetPosition() *position.Position {
return n.Position
}
func (n *GreaterOrEqual) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Identical node
type Identical struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewIdentical node constructor
func NewIdentical(Variable node.Node, Expression node.Node) *Identical {
return &Identical{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Identical) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Identical) GetPosition() *position.Position {
return n.Position
}
func (n *Identical) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// LogicalAnd node
type LogicalAnd struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewLogicalAnd node constructor
func NewLogicalAnd(Variable node.Node, Expression node.Node) *LogicalAnd {
return &LogicalAnd{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *LogicalAnd) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *LogicalAnd) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalAnd) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// LogicalOr node
type LogicalOr struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewLogicalOr node constructor
func NewLogicalOr(Variable node.Node, Expression node.Node) *LogicalOr {
return &LogicalOr{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *LogicalOr) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *LogicalOr) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalOr) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// LogicalXor node
type LogicalXor struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewLogicalXor node constructor
func NewLogicalXor(Variable node.Node, Expression node.Node) *LogicalXor {
return &LogicalXor{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *LogicalXor) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *LogicalXor) GetPosition() *position.Position {
return n.Position
}
func (n *LogicalXor) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Minus node
type Minus struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewMinus node constructor
func NewMinus(Variable node.Node, Expression node.Node) *Minus {
return &Minus{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Minus) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Minus) GetPosition() *position.Position {
return n.Position
}
func (n *Minus) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Mod node
type Mod struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewMod node constructor
func NewMod(Variable node.Node, Expression node.Node) *Mod {
return &Mod{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Mod) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Mod) GetPosition() *position.Position {
return n.Position
}
func (n *Mod) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Mul node
type Mul struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewMul node constructor
func NewMul(Variable node.Node, Expression node.Node) *Mul {
return &Mul{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Mul) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Mul) GetPosition() *position.Position {
return n.Position
}
func (n *Mul) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// NotEqual node
type NotEqual struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewNotEqual node constructor
func NewNotEqual(Variable node.Node, Expression node.Node) *NotEqual {
return &NotEqual{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *NotEqual) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *NotEqual) GetPosition() *position.Position {
return n.Position
}
func (n *NotEqual) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// NotIdentical node
type NotIdentical struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewNotIdentical node constructor
func NewNotIdentical(Variable node.Node, Expression node.Node) *NotIdentical {
return &NotIdentical{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *NotIdentical) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *NotIdentical) GetPosition() *position.Position {
return n.Position
}
func (n *NotIdentical) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Plus node
type Plus struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewPlus node constructor
func NewPlus(Variable node.Node, Expression node.Node) *Plus {
return &Plus{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Plus) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Plus) GetPosition() *position.Position {
return n.Position
}
func (n *Plus) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Pow node
type Pow struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewPow node constructor
func NewPow(Variable node.Node, Expression node.Node) *Pow {
return &Pow{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Pow) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Pow) GetPosition() *position.Position {
return n.Position
}
func (n *Pow) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ShiftLeft node
type ShiftLeft struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewShiftLeft node constructor
func NewShiftLeft(Variable node.Node, Expression node.Node) *ShiftLeft {
return &ShiftLeft{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *ShiftLeft) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ShiftLeft) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftLeft) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ShiftRight node
type ShiftRight struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewShiftRight node constructor
func NewShiftRight(Variable node.Node, Expression node.Node) *ShiftRight {
return &ShiftRight{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *ShiftRight) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ShiftRight) GetPosition() *position.Position {
return n.Position
}
func (n *ShiftRight) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Smaller node
type Smaller struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewSmaller node constructor
func NewSmaller(Variable node.Node, Expression node.Node) *Smaller {
return &Smaller{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Smaller) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Smaller) GetPosition() *position.Position {
return n.Position
}
func (n *Smaller) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// SmallerOrEqual node
type SmallerOrEqual struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewSmallerOrEqual node constructor
func NewSmallerOrEqual(Variable node.Node, Expression node.Node) *SmallerOrEqual {
return &SmallerOrEqual{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *SmallerOrEqual) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *SmallerOrEqual) GetPosition() *position.Position {
return n.Position
}
func (n *SmallerOrEqual) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package binary
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Spaceship node
type Spaceship struct {
FreeFloating freefloating.Collection
Position *position.Position
Left node.Node
Right node.Node
}
// NewSpaceship node constructor
func NewSpaceship(Variable node.Node, Expression node.Node) *Spaceship {
return &Spaceship{
FreeFloating: nil,
Left: Variable,
Right: Expression,
}
}
// SetPosition sets node position
func (n *Spaceship) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Spaceship) GetPosition() *position.Position {
return n.Position
}
func (n *Spaceship) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Left != nil {
v.EnterChildNode("Left", n)
n.Left.Walk(v)
v.LeaveChildNode("Left", n)
}
if n.Right != nil {
v.EnterChildNode("Right", n)
n.Right.Walk(v)
v.LeaveChildNode("Right", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package cast
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Array node
type Array struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewArray node constructor
func NewArray(Expr node.Node) *Array {
return &Array{
FreeFloating: nil,
Expr: Expr,
}
}
// SetPosition sets node position
func (n *Array) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Array) GetPosition() *position.Position {
return n.Position
}
func (n *Array) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package cast
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Bool node
type Bool struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewBool node constructor
func NewBool(Expr node.Node) *Bool {
return &Bool{
FreeFloating: nil,
Expr: Expr,
}
}
// SetPosition sets node position
func (n *Bool) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Bool) GetPosition() *position.Position {
return n.Position
}
func (n *Bool) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Bool) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Bool) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package cast
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Double node
type Double struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewDouble node constructor
func NewDouble(Expr node.Node) *Double {
return &Double{
FreeFloating: nil,
Expr: Expr,
}
}
// SetPosition sets node position
func (n *Double) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Double) GetPosition() *position.Position {
return n.Position
}
func (n *Double) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Double) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Double) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package cast
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Int node
type Int struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewInt node constructor
func NewInt(Expr node.Node) *Int {
return &Int{
FreeFloating: nil,
Expr: Expr,
}
}
// SetPosition sets node position
func (n *Int) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Int) GetPosition() *position.Position {
return n.Position
}
func (n *Int) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Int) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Int) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package cast
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Object node
type Object struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewObject node constructor
func NewObject(Expr node.Node) *Object {
return &Object{
FreeFloating: nil,
Expr: Expr,
}
}
// SetPosition sets node position
func (n *Object) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Object) GetPosition() *position.Position {
return n.Position
}
func (n *Object) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Object) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Object) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package cast
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// String node
type String struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewString node constructor
func NewString(Expr node.Node) *String {
return &String{
FreeFloating: nil,
Expr: Expr,
}
}
// SetPosition sets node position
func (n *String) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *String) GetPosition() *position.Position {
return n.Position
}
func (n *String) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *String) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *String) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package cast
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Unset node
type Unset struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewUnset node constructor
func NewUnset(Expr node.Node) *Unset {
return &Unset{
FreeFloating: nil,
Expr: Expr,
}
}
// SetPosition sets node position
func (n *Unset) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Unset) GetPosition() *position.Position {
return n.Position
}
func (n *Unset) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,62 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Array node
type Array struct {
FreeFloating freefloating.Collection
Position *position.Position
Items []node.Node
}
// NewArray node constructor
func NewArray(Items []node.Node) *Array {
return &Array{
FreeFloating: nil,
Items: Items,
}
}
// SetPosition sets node position
func (n *Array) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Array) GetPosition() *position.Position {
return n.Position
}
func (n *Array) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Items != nil {
v.EnterChildList("Items", n)
for _, nn := range n.Items {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Items", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ArrayDimFetch node
type ArrayDimFetch struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Dim node.Node
}
// NewArrayDimFetch node constructor
func NewArrayDimFetch(Variable node.Node, Dim node.Node) *ArrayDimFetch {
return &ArrayDimFetch{
FreeFloating: nil,
Variable: Variable,
Dim: Dim,
}
}
// SetPosition sets node position
func (n *ArrayDimFetch) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ArrayDimFetch) GetPosition() *position.Position {
return n.Position
}
func (n *ArrayDimFetch) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Dim != nil {
v.EnterChildNode("Dim", n)
n.Dim.Walk(v)
v.LeaveChildNode("Dim", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,70 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ArrayItem node
type ArrayItem struct {
FreeFloating freefloating.Collection
Position *position.Position
Key node.Node
Val node.Node
Unpack bool
}
// NewArrayItem node constructor
func NewArrayItem(Key node.Node, Val node.Node, Unpack bool) *ArrayItem {
return &ArrayItem{
FreeFloating: nil,
Key: Key,
Val: Val,
Unpack: Unpack,
}
}
// SetPosition sets node position
func (n *ArrayItem) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ArrayItem) GetPosition() *position.Position {
return n.Position
}
func (n *ArrayItem) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *ArrayItem) Attributes() map[string]interface{} {
return map[string]interface{}{
"Unpack": n.Unpack,
}
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *ArrayItem) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Key != nil {
v.EnterChildNode("Key", n)
n.Key.Walk(v)
v.LeaveChildNode("Key", n)
}
if n.Val != nil {
v.EnterChildNode("Val", n)
n.Val.Walk(v)
v.LeaveChildNode("Val", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,88 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ArrowFunction node
type ArrowFunction struct {
FreeFloating freefloating.Collection
Position *position.Position
ReturnsRef bool
Static bool
PhpDocComment string
Params []node.Node
ReturnType node.Node
Expr node.Node
}
// NewArrowFunction node constructor
func NewArrowFunction(Params []node.Node, ReturnType node.Node, Stmt node.Node, Static bool, ReturnsRef bool, PhpDocComment string) *ArrowFunction {
return &ArrowFunction{
FreeFloating: nil,
ReturnsRef: ReturnsRef,
Static: Static,
PhpDocComment: PhpDocComment,
Params: Params,
ReturnType: ReturnType,
Expr: Stmt,
}
}
// SetPosition sets node position
func (n *ArrowFunction) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ArrowFunction) GetPosition() *position.Position {
return n.Position
}
func (n *ArrowFunction) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *ArrowFunction) Attributes() map[string]interface{} {
return map[string]interface{}{
"ReturnsRef": n.ReturnsRef,
"Static": n.Static,
"PhpDocComment": n.PhpDocComment,
}
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *ArrowFunction) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Params != nil {
v.EnterChildList("Params", n)
for _, nn := range n.Params {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Params", n)
}
if n.ReturnType != nil {
v.EnterChildNode("ReturnType", n)
n.ReturnType.Walk(v)
v.LeaveChildNode("ReturnType", n)
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BitwiseNot node
type BitwiseNot struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewBitwiseNot node constructor
func NewBitwiseNot(Expression node.Node) *BitwiseNot {
return &BitwiseNot{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *BitwiseNot) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BitwiseNot) GetPosition() *position.Position {
return n.Position
}
func (n *BitwiseNot) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// BooleanNot node
type BooleanNot struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewBooleanNot node constructor
func NewBooleanNot(Expression node.Node) *BooleanNot {
return &BooleanNot{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *BooleanNot) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *BooleanNot) GetPosition() *position.Position {
return n.Position
}
func (n *BooleanNot) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ClassConstFetch node
type ClassConstFetch struct {
FreeFloating freefloating.Collection
Position *position.Position
Class node.Node
ConstantName node.Node
}
// NewClassConstFetch node constructor
func NewClassConstFetch(Class node.Node, ConstantName node.Node) *ClassConstFetch {
return &ClassConstFetch{
FreeFloating: nil,
Class: Class,
ConstantName: ConstantName,
}
}
// SetPosition sets node position
func (n *ClassConstFetch) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ClassConstFetch) GetPosition() *position.Position {
return n.Position
}
func (n *ClassConstFetch) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Class != nil {
v.EnterChildNode("Class", n)
n.Class.Walk(v)
v.LeaveChildNode("Class", n)
}
if n.ConstantName != nil {
v.EnterChildNode("ConstantName", n)
n.ConstantName.Walk(v)
v.LeaveChildNode("ConstantName", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Clone node
type Clone struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewClone node constructor
func NewClone(Expression node.Node) *Clone {
return &Clone{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *Clone) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Clone) GetPosition() *position.Position {
return n.Position
}
func (n *Clone) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,100 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Closure node
type Closure struct {
FreeFloating freefloating.Collection
Position *position.Position
ReturnsRef bool
Static bool
PhpDocComment string
Params []node.Node
ClosureUse *ClosureUse
ReturnType node.Node
Stmts []node.Node
}
// NewClosure node constructor
func NewClosure(Params []node.Node, ClosureUse *ClosureUse, ReturnType node.Node, Stmts []node.Node, Static bool, ReturnsRef bool, PhpDocComment string) *Closure {
return &Closure{
FreeFloating: nil,
ReturnsRef: ReturnsRef,
Static: Static,
PhpDocComment: PhpDocComment,
Params: Params,
ClosureUse: ClosureUse,
ReturnType: ReturnType,
Stmts: Stmts,
}
}
// SetPosition sets node position
func (n *Closure) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Closure) GetPosition() *position.Position {
return n.Position
}
func (n *Closure) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Closure) Attributes() map[string]interface{} {
return map[string]interface{}{
"ReturnsRef": n.ReturnsRef,
"Static": n.Static,
"PhpDocComment": n.PhpDocComment,
}
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Closure) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Params != nil {
v.EnterChildList("Params", n)
for _, nn := range n.Params {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Params", n)
}
if n.ClosureUse != nil {
v.EnterChildNode("ClosureUse", n)
n.ClosureUse.Walk(v)
v.LeaveChildNode("ClosureUse", n)
}
if n.ReturnType != nil {
v.EnterChildNode("ReturnType", n)
n.ReturnType.Walk(v)
v.LeaveChildNode("ReturnType", n)
}
if n.Stmts != nil {
v.EnterChildList("Stmts", n)
for _, nn := range n.Stmts {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Stmts", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,62 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ClosureUse node
type ClosureUse struct {
FreeFloating freefloating.Collection
Position *position.Position
Uses []node.Node
}
// NewClosureUse node constructor
func NewClosureUse(Uses []node.Node) *ClosureUse {
return &ClosureUse{
FreeFloating: nil,
Uses: Uses,
}
}
// SetPosition sets node position
func (n *ClosureUse) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ClosureUse) GetPosition() *position.Position {
return n.Position
}
func (n *ClosureUse) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *ClosureUse) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *ClosureUse) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Uses != nil {
v.EnterChildList("Uses", n)
for _, nn := range n.Uses {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Uses", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ConstFetch node
type ConstFetch struct {
FreeFloating freefloating.Collection
Position *position.Position
Constant node.Node
}
// NewConstFetch node constructor
func NewConstFetch(Constant node.Node) *ConstFetch {
return &ConstFetch{
FreeFloating: nil,
Constant: Constant,
}
}
// SetPosition sets node position
func (n *ConstFetch) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ConstFetch) GetPosition() *position.Position {
return n.Position
}
func (n *ConstFetch) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Constant != nil {
v.EnterChildNode("Constant", n)
n.Constant.Walk(v)
v.LeaveChildNode("Constant", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Empty node
type Empty struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewEmpty node constructor
func NewEmpty(Expression node.Node) *Empty {
return &Empty{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *Empty) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Empty) GetPosition() *position.Position {
return n.Position
}
func (n *Empty) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ErrorSuppress node
type ErrorSuppress struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewErrorSuppress node constructor
func NewErrorSuppress(Expression node.Node) *ErrorSuppress {
return &ErrorSuppress{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *ErrorSuppress) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ErrorSuppress) GetPosition() *position.Position {
return n.Position
}
func (n *ErrorSuppress) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Eval node
type Eval struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewEval node constructor
func NewEval(Expression node.Node) *Eval {
return &Eval{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *Eval) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Eval) GetPosition() *position.Position {
return n.Position
}
func (n *Eval) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,61 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Exit node
type Exit struct {
FreeFloating freefloating.Collection
Die bool
Position *position.Position
Expr node.Node
}
// NewExit node constructor
func NewExit(Expr node.Node) *Exit {
return &Exit{
FreeFloating: nil,
Expr: Expr,
}
}
// SetPosition sets node position
func (n *Exit) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Exit) GetPosition() *position.Position {
return n.Position
}
func (n *Exit) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Exit) Attributes() map[string]interface{} {
return map[string]interface{}{
"Die": n.Die,
}
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Exit) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// FunctionCall node
type FunctionCall struct {
FreeFloating freefloating.Collection
Position *position.Position
Function node.Node
ArgumentList *node.ArgumentList
}
// NewFunctionCall node constructor
func NewFunctionCall(Function node.Node, ArgumentList *node.ArgumentList) *FunctionCall {
return &FunctionCall{
FreeFloating: nil,
Function: Function,
ArgumentList: ArgumentList,
}
}
// SetPosition sets node position
func (n *FunctionCall) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *FunctionCall) GetPosition() *position.Position {
return n.Position
}
func (n *FunctionCall) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Function != nil {
v.EnterChildNode("Function", n)
n.Function.Walk(v)
v.LeaveChildNode("Function", n)
}
if n.ArgumentList != nil {
v.EnterChildNode("ArgumentList", n)
n.ArgumentList.Walk(v)
v.LeaveChildNode("ArgumentList", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Include node
type Include struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewInclude node constructor
func NewInclude(Expression node.Node) *Include {
return &Include{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *Include) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Include) GetPosition() *position.Position {
return n.Position
}
func (n *Include) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// IncludeOnce node
type IncludeOnce struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewIncludeOnce node constructor
func NewIncludeOnce(Expression node.Node) *IncludeOnce {
return &IncludeOnce{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *IncludeOnce) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *IncludeOnce) GetPosition() *position.Position {
return n.Position
}
func (n *IncludeOnce) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// InstanceOf node
type InstanceOf struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
Class node.Node
}
// NewInstanceOf node constructor
func NewInstanceOf(Expr node.Node, Class node.Node) *InstanceOf {
return &InstanceOf{
FreeFloating: nil,
Expr: Expr,
Class: Class,
}
}
// SetPosition sets node position
func (n *InstanceOf) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *InstanceOf) GetPosition() *position.Position {
return n.Position
}
func (n *InstanceOf) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
if n.Class != nil {
v.EnterChildNode("Class", n)
n.Class.Walk(v)
v.LeaveChildNode("Class", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,62 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Isset node
type Isset struct {
FreeFloating freefloating.Collection
Position *position.Position
Variables []node.Node
}
// NewIsset node constructor
func NewIsset(Variables []node.Node) *Isset {
return &Isset{
FreeFloating: nil,
Variables: Variables,
}
}
// SetPosition sets node position
func (n *Isset) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Isset) GetPosition() *position.Position {
return n.Position
}
func (n *Isset) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variables != nil {
v.EnterChildList("Variables", n)
for _, nn := range n.Variables {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Variables", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,62 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// List node
type List struct {
FreeFloating freefloating.Collection
Position *position.Position
Items []node.Node
}
// NewList node constructor
func NewList(Items []node.Node) *List {
return &List{
FreeFloating: nil,
Items: Items,
}
}
// SetPosition sets node position
func (n *List) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *List) GetPosition() *position.Position {
return n.Position
}
func (n *List) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Items != nil {
v.EnterChildList("Items", n)
for _, nn := range n.Items {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Items", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,74 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// MethodCall node
type MethodCall struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Method node.Node
ArgumentList *node.ArgumentList
}
// NewMethodCall node constructor
func NewMethodCall(Variable node.Node, Method node.Node, ArgumentList *node.ArgumentList) *MethodCall {
return &MethodCall{
FreeFloating: nil,
Variable: Variable,
Method: Method,
ArgumentList: ArgumentList,
}
}
// SetPosition sets node position
func (n *MethodCall) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *MethodCall) GetPosition() *position.Position {
return n.Position
}
func (n *MethodCall) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Method != nil {
v.EnterChildNode("Method", n)
n.Method.Walk(v)
v.LeaveChildNode("Method", n)
}
if n.ArgumentList != nil {
v.EnterChildNode("ArgumentList", n)
n.ArgumentList.Walk(v)
v.LeaveChildNode("ArgumentList", n)
}
v.LeaveNode(n)
}

66
vendor/github.com/z7zmey/php-parser/node/expr/n_new.go generated vendored Normal file
View File

@ -0,0 +1,66 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// New node
type New struct {
FreeFloating freefloating.Collection
Position *position.Position
Class node.Node
ArgumentList *node.ArgumentList
}
// NewNew node constructor
func NewNew(Class node.Node, ArgumentList *node.ArgumentList) *New {
return &New{
FreeFloating: nil,
Class: Class,
ArgumentList: ArgumentList,
}
}
// SetPosition sets node position
func (n *New) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *New) GetPosition() *position.Position {
return n.Position
}
func (n *New) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Class != nil {
v.EnterChildNode("Class", n)
n.Class.Walk(v)
v.LeaveChildNode("Class", n)
}
if n.ArgumentList != nil {
v.EnterChildNode("ArgumentList", n)
n.ArgumentList.Walk(v)
v.LeaveChildNode("ArgumentList", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// PostDec node
type PostDec struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
}
// NewPostDec node constructor
func NewPostDec(Variable node.Node) *PostDec {
return &PostDec{
FreeFloating: nil,
Variable: Variable,
}
}
// SetPosition sets node position
func (n *PostDec) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *PostDec) GetPosition() *position.Position {
return n.Position
}
func (n *PostDec) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// PostInc node
type PostInc struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
}
// NewPostInc node constructor
func NewPostInc(Variable node.Node) *PostInc {
return &PostInc{
FreeFloating: nil,
Variable: Variable,
}
}
// SetPosition sets node position
func (n *PostInc) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *PostInc) GetPosition() *position.Position {
return n.Position
}
func (n *PostInc) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// PreDec node
type PreDec struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
}
// NewPreDec node constructor
func NewPreDec(Variable node.Node) *PreDec {
return &PreDec{
FreeFloating: nil,
Variable: Variable,
}
}
// SetPosition sets node position
func (n *PreDec) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *PreDec) GetPosition() *position.Position {
return n.Position
}
func (n *PreDec) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// PreInc node
type PreInc struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
}
// NewPreInc node constructor
func NewPreInc(Variable node.Node) *PreInc {
return &PreInc{
FreeFloating: nil,
Variable: Variable,
}
}
// SetPosition sets node position
func (n *PreInc) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *PreInc) GetPosition() *position.Position {
return n.Position
}
func (n *PreInc) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Print node
type Print struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewPrint node constructor
func NewPrint(Expression node.Node) *Print {
return &Print{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *Print) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Print) GetPosition() *position.Position {
return n.Position
}
func (n *Print) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// PropertyFetch node
type PropertyFetch struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
Property node.Node
}
// NewPropertyFetch node constructor
func NewPropertyFetch(Variable node.Node, Property node.Node) *PropertyFetch {
return &PropertyFetch{
FreeFloating: nil,
Variable: Variable,
Property: Property,
}
}
// SetPosition sets node position
func (n *PropertyFetch) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *PropertyFetch) GetPosition() *position.Position {
return n.Position
}
func (n *PropertyFetch) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
if n.Property != nil {
v.EnterChildNode("Property", n)
n.Property.Walk(v)
v.LeaveChildNode("Property", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Reference node
type Reference struct {
FreeFloating freefloating.Collection
Position *position.Position
Variable node.Node
}
// NewReference node constructor
func NewReference(Variable node.Node) *Reference {
return &Reference{
FreeFloating: nil,
Variable: Variable,
}
}
// SetPosition sets node position
func (n *Reference) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Reference) GetPosition() *position.Position {
return n.Position
}
func (n *Reference) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Reference) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Reference) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Variable != nil {
v.EnterChildNode("Variable", n)
n.Variable.Walk(v)
v.LeaveChildNode("Variable", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Require node
type Require struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewRequire node constructor
func NewRequire(Expression node.Node) *Require {
return &Require{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *Require) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Require) GetPosition() *position.Position {
return n.Position
}
func (n *Require) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// RequireOnce node
type RequireOnce struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewRequireOnce node constructor
func NewRequireOnce(Expression node.Node) *RequireOnce {
return &RequireOnce{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *RequireOnce) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *RequireOnce) GetPosition() *position.Position {
return n.Position
}
func (n *RequireOnce) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,62 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ShellExec node
type ShellExec struct {
FreeFloating freefloating.Collection
Position *position.Position
Parts []node.Node
}
// NewShellExec node constructor
func NewShellExec(Parts []node.Node) *ShellExec {
return &ShellExec{
FreeFloating: nil,
Parts: Parts,
}
}
// SetPosition sets node position
func (n *ShellExec) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ShellExec) GetPosition() *position.Position {
return n.Position
}
func (n *ShellExec) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Parts != nil {
v.EnterChildList("Parts", n)
for _, nn := range n.Parts {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Parts", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,62 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ShortArray node
type ShortArray struct {
FreeFloating freefloating.Collection
Position *position.Position
Items []node.Node
}
// NewShortArray node constructor
func NewShortArray(Items []node.Node) *ShortArray {
return &ShortArray{
FreeFloating: nil,
Items: Items,
}
}
// SetPosition sets node position
func (n *ShortArray) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ShortArray) GetPosition() *position.Position {
return n.Position
}
func (n *ShortArray) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Items != nil {
v.EnterChildList("Items", n)
for _, nn := range n.Items {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Items", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,62 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ShortList node
type ShortList struct {
FreeFloating freefloating.Collection
Position *position.Position
Items []node.Node
}
// NewShortList node constructor
func NewShortList(Items []node.Node) *ShortList {
return &ShortList{
FreeFloating: nil,
Items: Items,
}
}
// SetPosition sets node position
func (n *ShortList) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ShortList) GetPosition() *position.Position {
return n.Position
}
func (n *ShortList) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Items != nil {
v.EnterChildList("Items", n)
for _, nn := range n.Items {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Items", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,74 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// StaticCall node
type StaticCall struct {
FreeFloating freefloating.Collection
Position *position.Position
Class node.Node
Call node.Node
ArgumentList *node.ArgumentList
}
// NewStaticCall node constructor
func NewStaticCall(Class node.Node, Call node.Node, ArgumentList *node.ArgumentList) *StaticCall {
return &StaticCall{
FreeFloating: nil,
Class: Class,
Call: Call,
ArgumentList: ArgumentList,
}
}
// SetPosition sets node position
func (n *StaticCall) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *StaticCall) GetPosition() *position.Position {
return n.Position
}
func (n *StaticCall) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Class != nil {
v.EnterChildNode("Class", n)
n.Class.Walk(v)
v.LeaveChildNode("Class", n)
}
if n.Call != nil {
v.EnterChildNode("Call", n)
n.Call.Walk(v)
v.LeaveChildNode("Call", n)
}
if n.ArgumentList != nil {
v.EnterChildNode("ArgumentList", n)
n.ArgumentList.Walk(v)
v.LeaveChildNode("ArgumentList", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// StaticPropertyFetch node
type StaticPropertyFetch struct {
FreeFloating freefloating.Collection
Position *position.Position
Class node.Node
Property node.Node
}
// NewStaticPropertyFetch node constructor
func NewStaticPropertyFetch(Class node.Node, Property node.Node) *StaticPropertyFetch {
return &StaticPropertyFetch{
FreeFloating: nil,
Class: Class,
Property: Property,
}
}
// SetPosition sets node position
func (n *StaticPropertyFetch) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *StaticPropertyFetch) GetPosition() *position.Position {
return n.Position
}
func (n *StaticPropertyFetch) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Class != nil {
v.EnterChildNode("Class", n)
n.Class.Walk(v)
v.LeaveChildNode("Class", n)
}
if n.Property != nil {
v.EnterChildNode("Property", n)
n.Property.Walk(v)
v.LeaveChildNode("Property", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,74 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Ternary node
type Ternary struct {
FreeFloating freefloating.Collection
Position *position.Position
Condition node.Node
IfTrue node.Node
IfFalse node.Node
}
// NewTernary node constructor
func NewTernary(Condition node.Node, IfTrue node.Node, IfFalse node.Node) *Ternary {
return &Ternary{
FreeFloating: nil,
Condition: Condition,
IfTrue: IfTrue,
IfFalse: IfFalse,
}
}
// SetPosition sets node position
func (n *Ternary) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Ternary) GetPosition() *position.Position {
return n.Position
}
func (n *Ternary) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Condition != nil {
v.EnterChildNode("Condition", n)
n.Condition.Walk(v)
v.LeaveChildNode("Condition", n)
}
if n.IfTrue != nil {
v.EnterChildNode("IfTrue", n)
n.IfTrue.Walk(v)
v.LeaveChildNode("IfTrue", n)
}
if n.IfFalse != nil {
v.EnterChildNode("IfFalse", n)
n.IfFalse.Walk(v)
v.LeaveChildNode("IfFalse", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// UnaryMinus node
type UnaryMinus struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewUnaryMinus node constructor
func NewUnaryMinus(Expression node.Node) *UnaryMinus {
return &UnaryMinus{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *UnaryMinus) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *UnaryMinus) GetPosition() *position.Position {
return n.Position
}
func (n *UnaryMinus) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// UnaryPlus node
type UnaryPlus struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewUnaryPlus node constructor
func NewUnaryPlus(Expression node.Node) *UnaryPlus {
return &UnaryPlus{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *UnaryPlus) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *UnaryPlus) GetPosition() *position.Position {
return n.Position
}
func (n *UnaryPlus) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,63 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Variable node
type Variable struct {
FreeFloating freefloating.Collection
Position *position.Position
VarName node.Node
}
// NewVariable node constructor
func NewVariable(VarName node.Node) *Variable {
return &Variable{
FreeFloating: nil,
VarName: VarName,
}
}
// SetPosition sets node position
func (n *Variable) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Variable) GetPosition() *position.Position {
return n.Position
}
func (n *Variable) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Variable) Attributes() map[string]interface{} {
return nil
}
// SetVarName reset var name
func (n *Variable) SetVarName(VarName node.Node) {
n.VarName = VarName
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Variable) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.VarName != nil {
v.EnterChildNode("VarName", n)
n.VarName.Walk(v)
v.LeaveChildNode("VarName", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,66 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Yield node
type Yield struct {
FreeFloating freefloating.Collection
Position *position.Position
Key node.Node
Value node.Node
}
// NewYield node constructor
func NewYield(Key node.Node, Value node.Node) *Yield {
return &Yield{
FreeFloating: nil,
Key: Key,
Value: Value,
}
}
// SetPosition sets node position
func (n *Yield) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Yield) GetPosition() *position.Position {
return n.Position
}
func (n *Yield) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Key != nil {
v.EnterChildNode("Key", n)
n.Key.Walk(v)
v.LeaveChildNode("Key", n)
}
if n.Value != nil {
v.EnterChildNode("Value", n)
n.Value.Walk(v)
v.LeaveChildNode("Value", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,58 @@
package expr
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// YieldFrom node
type YieldFrom struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr node.Node
}
// NewYieldFrom node constructor
func NewYieldFrom(Expression node.Node) *YieldFrom {
return &YieldFrom{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *YieldFrom) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *YieldFrom) GetPosition() *position.Position {
return n.Position
}
func (n *YieldFrom) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

64
vendor/github.com/z7zmey/php-parser/node/n_argument.go generated vendored Normal file
View File

@ -0,0 +1,64 @@
package node
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Argument node
type Argument struct {
FreeFloating freefloating.Collection
Position *position.Position
Variadic bool // if ... before variable
IsReference bool // if & before variable
Expr Node // Exression
}
// NewArgument node constructor
func NewArgument(Expression Node, Variadic bool, IsReference bool) *Argument {
return &Argument{
FreeFloating: nil,
Variadic: Variadic,
IsReference: IsReference,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *Argument) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Argument) GetPosition() *position.Position {
return n.Position
}
func (n *Argument) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *Argument) Attributes() map[string]interface{} {
return map[string]interface{}{
"Variadic": n.Variadic,
"IsReference": n.IsReference,
}
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *Argument) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,61 @@
package node
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// ArgumentList node
type ArgumentList struct {
FreeFloating freefloating.Collection
Position *position.Position
Arguments []Node
}
// NewArgumentList node constructor
func NewArgumentList(Arguments []Node) *ArgumentList {
return &ArgumentList{
FreeFloating: nil,
Arguments: Arguments,
}
}
// SetPosition sets node position
func (n *ArgumentList) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *ArgumentList) GetPosition() *position.Position {
return n.Position
}
func (n *ArgumentList) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// Attributes returns node attributes as map
func (n *ArgumentList) Attributes() map[string]interface{} {
return nil
}
// Walk traverses nodes
// Walk is invoked recursively until v.EnterNode returns true
func (n *ArgumentList) Walk(v walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Arguments != nil {
v.EnterChildList("Arguments", n)
for _, nn := range n.Arguments {
if nn != nil {
nn.Walk(v)
}
}
v.LeaveChildList("Arguments", n)
}
v.LeaveNode(n)
}

View File

@ -0,0 +1,53 @@
package node
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Identifier node
type Identifier struct {
FreeFloating freefloating.Collection
Position *position.Position
Value string
}
// NewIdentifier node constructor
func NewIdentifier(Value string) *Identifier {
return &Identifier{
FreeFloating: nil,
Value: Value,
}
}
// SetPosition sets node position
func (n *Identifier) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Identifier) GetPosition() *position.Position {
return n.Position
}
func (n *Identifier) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
v.LeaveNode(n)
}

57
vendor/github.com/z7zmey/php-parser/node/n_nullable.go generated vendored Normal file
View File

@ -0,0 +1,57 @@
package node
import (
"github.com/z7zmey/php-parser/freefloating"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker"
)
// Nullable node
type Nullable struct {
FreeFloating freefloating.Collection
Position *position.Position
Expr Node
}
// NewNullable node constructor
func NewNullable(Expression Node) *Nullable {
return &Nullable{
FreeFloating: nil,
Expr: Expression,
}
}
// SetPosition sets node position
func (n *Nullable) SetPosition(p *position.Position) {
n.Position = p
}
// GetPosition returns node positions
func (n *Nullable) GetPosition() *position.Position {
return n.Position
}
func (n *Nullable) GetFreeFloating() *freefloating.Collection {
return &n.FreeFloating
}
// 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 walker.Visitor) {
if v.EnterNode(n) == false {
return
}
if n.Expr != nil {
v.EnterChildNode("Expr", n)
n.Expr.Walk(v)
v.LeaveChildNode("Expr", n)
}
v.LeaveNode(n)
}

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