ir

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 5 Imported by: 3

Documentation

Overview

Code generated by the `ir/codegen` package. DO NOT EDIT.

Code generated by the `ir/codegen` package. DO NOT EDIT.

Code generated by the `ir/codegen` package. DO NOT EDIT.

Package ir declares intermediate representation type suitable for the analysis.

IR is generated from the AST, see ir/irconv package.

Code generated by the `ir/codegen` package. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPosition

func GetPosition(n Node) *position.Position

Types

type AnonClassExpr

type AnonClassExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Class

	ArgsFreeFloating freefloating.Collection
	Args             []Node
}

AnonClassExpr is an anonymous class expression. $Args may contain constructor call arguments `new class ($Args...) {}`.

func (*AnonClassExpr) Arg

func (n *AnonClassExpr) Arg(i int) *Argument

Arg returns the ith argument.

func (*AnonClassExpr) GetFreeFloating

func (n *AnonClassExpr) GetFreeFloating() *freefloating.Collection

func (*AnonClassExpr) Walk

func (n *AnonClassExpr) Walk(v Visitor)

type Argument

type Argument struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variadic     bool
	IsReference  bool
	Expr         Node
}

Argument is a wrapper node for func/method arguments. If $Variadic is true, it's `...$Expr`. If $IsReference is true, it's `&$Expr`.

func (*Argument) GetFreeFloating

func (n *Argument) GetFreeFloating() *freefloating.Collection

func (*Argument) Walk

func (n *Argument) Walk(v Visitor)

type ArrayDimFetchExpr

type ArrayDimFetchExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Dim          Node
}

ArrayDimFetchExpr is a `$Variable[$Dim]` expression.

func (*ArrayDimFetchExpr) GetFreeFloating

func (n *ArrayDimFetchExpr) GetFreeFloating() *freefloating.Collection

func (*ArrayDimFetchExpr) Walk

func (n *ArrayDimFetchExpr) Walk(v Visitor)

type ArrayExpr

type ArrayExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Items        []*ArrayItemExpr
	ShortSyntax  bool
}

ArrayExpr is a `array($Items...)` expression. If $ShortSyntax is true, it's `[$Items...]`.

func (*ArrayExpr) GetFreeFloating

func (n *ArrayExpr) GetFreeFloating() *freefloating.Collection

func (*ArrayExpr) Walk

func (n *ArrayExpr) Walk(v Visitor)

type ArrayItemExpr

type ArrayItemExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Key          Node
	Val          Node
	Unpack       bool
}

ArrayItemExpr is a `$Key => $Val` expression. If $Unpack is true, it's `...$Val` ($Key is nil).

TODO: make unpack a separate node?

func (*ArrayItemExpr) GetFreeFloating

func (n *ArrayItemExpr) GetFreeFloating() *freefloating.Collection

func (*ArrayItemExpr) Walk

func (n *ArrayItemExpr) Walk(v Visitor)

type ArrowFunctionExpr

type ArrowFunctionExpr struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	ReturnsRef    bool
	Static        bool
	PhpDocComment string
	PhpDoc        []phpdoc.CommentPart
	Params        []Node
	ReturnType    Node
	Expr          Node
}

ArrowFunctionExpr is a `fn($Params...): $ReturnType => $Expr` expression. If $ReturnsRef is true, it's `fn&($Params...): $ReturnType => $Expr`. If $Static is true, it's `static fn($Params...): $ReturnType => $Expr`. $ReturnType is optional, without it we have `fn($Params...) => $Expr` syntax.

func (*ArrowFunctionExpr) GetFreeFloating

func (n *ArrowFunctionExpr) GetFreeFloating() *freefloating.Collection

func (*ArrowFunctionExpr) Walk

func (n *ArrowFunctionExpr) Walk(v Visitor)

type Assign

type Assign struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

Assign is a `$Variable = $Expression` expression.

func (*Assign) GetFreeFloating

func (n *Assign) GetFreeFloating() *freefloating.Collection

func (*Assign) Walk

func (n *Assign) Walk(v Visitor)

type AssignBitwiseAnd

type AssignBitwiseAnd struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignBitwiseAnd is a `$Variable &= $Expression` expression.

func (*AssignBitwiseAnd) GetFreeFloating

func (n *AssignBitwiseAnd) GetFreeFloating() *freefloating.Collection

func (*AssignBitwiseAnd) Walk

func (n *AssignBitwiseAnd) Walk(v Visitor)

type AssignBitwiseOr

type AssignBitwiseOr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignBitwiseOr is a `$Variable |= $Expression` expression.

func (*AssignBitwiseOr) GetFreeFloating

func (n *AssignBitwiseOr) GetFreeFloating() *freefloating.Collection

func (*AssignBitwiseOr) Walk

func (n *AssignBitwiseOr) Walk(v Visitor)

type AssignBitwiseXor

type AssignBitwiseXor struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignBitwiseXor is a `$Variable ^= $Expression` expression.

func (*AssignBitwiseXor) GetFreeFloating

func (n *AssignBitwiseXor) GetFreeFloating() *freefloating.Collection

func (*AssignBitwiseXor) Walk

func (n *AssignBitwiseXor) Walk(v Visitor)

type AssignCoalesce

type AssignCoalesce struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignCoalesce is a `$Variable ??= $Expression` expression.

func (*AssignCoalesce) GetFreeFloating

func (n *AssignCoalesce) GetFreeFloating() *freefloating.Collection

func (*AssignCoalesce) Walk

func (n *AssignCoalesce) Walk(v Visitor)

type AssignConcat

type AssignConcat struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignConcat is a `$Variable .= $Expression` expression.

func (*AssignConcat) GetFreeFloating

func (n *AssignConcat) GetFreeFloating() *freefloating.Collection

func (*AssignConcat) Walk

func (n *AssignConcat) Walk(v Visitor)

type AssignDiv

type AssignDiv struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignDiv is a `$Variable /= $Expression` expression.

func (*AssignDiv) GetFreeFloating

func (n *AssignDiv) GetFreeFloating() *freefloating.Collection

func (*AssignDiv) Walk

func (n *AssignDiv) Walk(v Visitor)

type AssignMinus

type AssignMinus struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignMinus is a `$Variable -= $Expression` expression.

func (*AssignMinus) GetFreeFloating

func (n *AssignMinus) GetFreeFloating() *freefloating.Collection

func (*AssignMinus) Walk

func (n *AssignMinus) Walk(v Visitor)

type AssignMod

type AssignMod struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignMod is a `$Variable %= $Expression` expression.

func (*AssignMod) GetFreeFloating

func (n *AssignMod) GetFreeFloating() *freefloating.Collection

func (*AssignMod) Walk

func (n *AssignMod) Walk(v Visitor)

type AssignMul

type AssignMul struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignMul is a `$Variable *= $Expression` expression.

func (*AssignMul) GetFreeFloating

func (n *AssignMul) GetFreeFloating() *freefloating.Collection

func (*AssignMul) Walk

func (n *AssignMul) Walk(v Visitor)

type AssignPlus

type AssignPlus struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignPlus is a `$Variable += $Expression` expression.

func (*AssignPlus) GetFreeFloating

func (n *AssignPlus) GetFreeFloating() *freefloating.Collection

func (*AssignPlus) Walk

func (n *AssignPlus) Walk(v Visitor)

type AssignPow

type AssignPow struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignPow is a `$Variable **= $Expression` expression.

func (*AssignPow) GetFreeFloating

func (n *AssignPow) GetFreeFloating() *freefloating.Collection

func (*AssignPow) Walk

func (n *AssignPow) Walk(v Visitor)

type AssignReference

type AssignReference struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignReference is a `$Variable &= $Expression` expression.

func (*AssignReference) GetFreeFloating

func (n *AssignReference) GetFreeFloating() *freefloating.Collection

func (*AssignReference) Walk

func (n *AssignReference) Walk(v Visitor)

type AssignShiftLeft

type AssignShiftLeft struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignShiftLeft is a `$Variable <<= $Expression` expression.

func (*AssignShiftLeft) GetFreeFloating

func (n *AssignShiftLeft) GetFreeFloating() *freefloating.Collection

func (*AssignShiftLeft) Walk

func (n *AssignShiftLeft) Walk(v Visitor)

type AssignShiftRight

type AssignShiftRight struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Expression   Node
}

AssignShiftRight is a `$Variable >>= $Expression` expression.

func (*AssignShiftRight) GetFreeFloating

func (n *AssignShiftRight) GetFreeFloating() *freefloating.Collection

func (*AssignShiftRight) Walk

func (n *AssignShiftRight) Walk(v Visitor)

type BadString

type BadString struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
	DoubleQuotes bool
	Error        string
}

BadString is a string that we couldn't interpret correctly. The $Value contains uninterpreted (raw) string bytes. $Error contains the reason why this string is "bad".

func (*BadString) GetFreeFloating

func (n *BadString) GetFreeFloating() *freefloating.Collection

func (*BadString) Walk

func (n *BadString) Walk(v Visitor)

type BitwiseAndExpr

type BitwiseAndExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

BitwiseAndExpr is a `$Left & $Right` expression.

func (*BitwiseAndExpr) GetFreeFloating

func (n *BitwiseAndExpr) GetFreeFloating() *freefloating.Collection

func (*BitwiseAndExpr) Walk

func (n *BitwiseAndExpr) Walk(v Visitor)

type BitwiseNotExpr

type BitwiseNotExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

BitwiseNotExpr is a `~$Expr` expression.

func (*BitwiseNotExpr) GetFreeFloating

func (n *BitwiseNotExpr) GetFreeFloating() *freefloating.Collection

func (*BitwiseNotExpr) Walk

func (n *BitwiseNotExpr) Walk(v Visitor)

type BitwiseOrExpr

type BitwiseOrExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

BitwiseOrExpr is a `$Left | $Right` expression.

func (*BitwiseOrExpr) GetFreeFloating

func (n *BitwiseOrExpr) GetFreeFloating() *freefloating.Collection

func (*BitwiseOrExpr) Walk

func (n *BitwiseOrExpr) Walk(v Visitor)

type BitwiseXorExpr

type BitwiseXorExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

BitwiseXorExpr is a `$Left ^ $Right` expression.

func (*BitwiseXorExpr) GetFreeFloating

func (n *BitwiseXorExpr) GetFreeFloating() *freefloating.Collection

func (*BitwiseXorExpr) Walk

func (n *BitwiseXorExpr) Walk(v Visitor)

type BooleanAndExpr

type BooleanAndExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

BooleanAndExpr is a `$Left && $Right` expression.

func (*BooleanAndExpr) GetFreeFloating

func (n *BooleanAndExpr) GetFreeFloating() *freefloating.Collection

func (*BooleanAndExpr) Walk

func (n *BooleanAndExpr) Walk(v Visitor)

type BooleanNotExpr

type BooleanNotExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

BooleanNotExpr is a `!$Expr` expression.

func (*BooleanNotExpr) GetFreeFloating

func (n *BooleanNotExpr) GetFreeFloating() *freefloating.Collection

func (*BooleanNotExpr) Walk

func (n *BooleanNotExpr) Walk(v Visitor)

type BooleanOrExpr

type BooleanOrExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

BooleanOrExpr is a `$Left || $Right` expression.

func (*BooleanOrExpr) GetFreeFloating

func (n *BooleanOrExpr) GetFreeFloating() *freefloating.Collection

func (*BooleanOrExpr) Walk

func (n *BooleanOrExpr) Walk(v Visitor)

type BreakStmt

type BreakStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

BreakStmt is a `break $Expr` statement.

func (*BreakStmt) GetFreeFloating

func (n *BreakStmt) GetFreeFloating() *freefloating.Collection

func (*BreakStmt) Walk

func (n *BreakStmt) Walk(v Visitor)

type CaseListStmt

type CaseListStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Cases        []Node
}

CaseListStmt is a wrapper node that contains all switch statement cases. TODO: can we get rid of it?

func (*CaseListStmt) GetFreeFloating

func (n *CaseListStmt) GetFreeFloating() *freefloating.Collection

func (*CaseListStmt) Walk

func (n *CaseListStmt) Walk(v Visitor)

type CaseStmt

type CaseStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Cond         Node
	Stmts        []Node
}

CaseStmt is a `case $Cond: $Stmts...` statement.

func (*CaseStmt) GetFreeFloating

func (n *CaseStmt) GetFreeFloating() *freefloating.Collection

func (*CaseStmt) Walk

func (n *CaseStmt) Walk(v Visitor)

type CatchStmt

type CatchStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Types        []Node
	Variable     *SimpleVar
	Stmts        []Node
}

CatchStmt is a `catch ($Types... $Variable) { $Stmts... }` statement. Note that $Types are |-separated, like in `T1 | T2`.

func (*CatchStmt) GetFreeFloating

func (n *CatchStmt) GetFreeFloating() *freefloating.Collection

func (*CatchStmt) Walk

func (n *CatchStmt) Walk(v Visitor)

type Class

type Class struct {
	PhpDocComment string
	PhpDoc        []phpdoc.CommentPart
	Extends       *ClassExtendsStmt
	Implements    *ClassImplementsStmt
	Stmts         []Node
}

Class is a common shape between the ClassStmt and AnonClassExpr. It doesn't include positions/freefloating info.

type ClassConstFetchExpr

type ClassConstFetchExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Class        Node
	ConstantName *Identifier
}

ClassConstFetchExpr is a `$Class::$ConstantName` expression.

func (*ClassConstFetchExpr) GetFreeFloating

func (n *ClassConstFetchExpr) GetFreeFloating() *freefloating.Collection

func (*ClassConstFetchExpr) Walk

func (n *ClassConstFetchExpr) Walk(v Visitor)

type ClassConstListStmt

type ClassConstListStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Modifiers    []*Identifier
	Consts       []Node
}

ClassConstListStmt is a `$Modifiers... const $Consts...` statement. $Modifiers may specify the constant access level. Every element in $Consts is a *ConstantStmt.

func (*ClassConstListStmt) GetFreeFloating

func (n *ClassConstListStmt) GetFreeFloating() *freefloating.Collection

func (*ClassConstListStmt) Walk

func (n *ClassConstListStmt) Walk(v Visitor)

type ClassExtendsStmt

type ClassExtendsStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	ClassName    *Name
}

ClassExtendsStmt is a `extends $ClassName` statement.

func (*ClassExtendsStmt) GetFreeFloating

func (n *ClassExtendsStmt) GetFreeFloating() *freefloating.Collection

func (*ClassExtendsStmt) Walk

func (n *ClassExtendsStmt) Walk(v Visitor)

type ClassImplementsStmt

type ClassImplementsStmt struct {
	FreeFloating   freefloating.Collection
	Position       *position.Position
	InterfaceNames []Node
}

ClassImplementsStmt is a `implements $InterfaceNames...` statement. TODO: shouldn't every InterfaceName be a *Name?

func (*ClassImplementsStmt) GetFreeFloating

func (n *ClassImplementsStmt) GetFreeFloating() *freefloating.Collection

func (*ClassImplementsStmt) Walk

func (n *ClassImplementsStmt) Walk(v Visitor)

type ClassMethodStmt

type ClassMethodStmt struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	ReturnsRef    bool
	PhpDocComment string
	PhpDoc        []phpdoc.CommentPart
	MethodName    *Identifier
	Modifiers     []*Identifier
	Params        []Node
	ReturnType    Node
	Stmt          Node
}

ClassMethodStmt is a class method declaration.

func (*ClassMethodStmt) GetFreeFloating

func (n *ClassMethodStmt) GetFreeFloating() *freefloating.Collection

func (*ClassMethodStmt) Walk

func (n *ClassMethodStmt) Walk(v Visitor)

type ClassStmt

type ClassStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	ClassName    *Identifier
	Modifiers    []*Identifier
	Class
}

ClassStmt is a named class declaration. $Modifiers consist of identifiers like `final` and `abstract`.

func (*ClassStmt) GetFreeFloating

func (n *ClassStmt) GetFreeFloating() *freefloating.Collection

func (*ClassStmt) Walk

func (n *ClassStmt) Walk(v Visitor)

type CloneExpr

type CloneExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

CloneExpr is a `clone $Expr` expression.

func (*CloneExpr) GetFreeFloating

func (n *CloneExpr) GetFreeFloating() *freefloating.Collection

func (*CloneExpr) Walk

func (n *CloneExpr) Walk(v Visitor)

type ClosureExpr

type ClosureExpr struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	ReturnsRef    bool
	Static        bool
	PhpDocComment string
	PhpDoc        []phpdoc.CommentPart
	Params        []Node
	ClosureUse    *ClosureUseExpr
	ReturnType    Node
	Stmts         []Node
}

ClosureExpr is a `function($Params...) use ($ClosureUse) : $ReturnType { $Stmts... }` expression. If $ReturnsRef is true, it's `function&($Params...) use ($ClosureUse) : $ReturnType { $Stmts... }`. If $Static is true, it's `static function($Params...) use ($ClosureUse) : $ReturnType { $Stmts... }`. $ReturnType is optional, without it we have `function($Params...) use ($ClosureUse) { $Stmts... }` syntax. $ClosureUse is optional, without it we have `function($Params...) : $ReturnType { $Stmts... }` syntax.

func (*ClosureExpr) GetFreeFloating

func (n *ClosureExpr) GetFreeFloating() *freefloating.Collection

func (*ClosureExpr) Walk

func (n *ClosureExpr) Walk(v Visitor)

type ClosureUseExpr

type ClosureUseExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Uses         []Node
}

ClosureUseExpr is a `use ($Uses...)` expression. TODO: it's not a expression really.

func (*ClosureUseExpr) GetFreeFloating

func (n *ClosureUseExpr) GetFreeFloating() *freefloating.Collection

func (*ClosureUseExpr) Walk

func (n *ClosureUseExpr) Walk(v Visitor)

type CoalesceExpr

type CoalesceExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

CoalesceExpr is a `$Left ?? $Right` expression.

func (*CoalesceExpr) GetFreeFloating

func (n *CoalesceExpr) GetFreeFloating() *freefloating.Collection

func (*CoalesceExpr) Walk

func (n *CoalesceExpr) Walk(v Visitor)

type ConcatExpr

type ConcatExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

ConcatExpr is a `$Left . $Right` expression.

func (*ConcatExpr) GetFreeFloating

func (n *ConcatExpr) GetFreeFloating() *freefloating.Collection

func (*ConcatExpr) Walk

func (n *ConcatExpr) Walk(v Visitor)

type ConstFetchExpr

type ConstFetchExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Constant     *Name
}

ConstFetchExpr is a `$Constant` expression.

func (*ConstFetchExpr) GetFreeFloating

func (n *ConstFetchExpr) GetFreeFloating() *freefloating.Collection

func (*ConstFetchExpr) Walk

func (n *ConstFetchExpr) Walk(v Visitor)

type ConstListStmt

type ConstListStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Consts       []Node
}

ConstListStmt is a `const $Consts` statement. Every element in $Consts is a *ConstantStmt.

func (*ConstListStmt) GetFreeFloating

func (n *ConstListStmt) GetFreeFloating() *freefloating.Collection

func (*ConstListStmt) Walk

func (n *ConstListStmt) Walk(v Visitor)

type ConstantStmt

type ConstantStmt struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	PhpDocComment string
	ConstantName  *Identifier
	Expr          Node
}

ConstantStmt is a `$ConstantName = $Expr` statement. It's a part of the *ConstListStmt, *ClassConstListStmt and *DeclareStmt.

func (*ConstantStmt) GetFreeFloating

func (n *ConstantStmt) GetFreeFloating() *freefloating.Collection

func (*ConstantStmt) Walk

func (n *ConstantStmt) Walk(v Visitor)

type ContinueStmt

type ContinueStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

ContinueStmt is a `continue $Expe` statement.

func (*ContinueStmt) GetFreeFloating

func (n *ContinueStmt) GetFreeFloating() *freefloating.Collection

func (*ContinueStmt) Walk

func (n *ContinueStmt) Walk(v Visitor)

type DeclareStmt

type DeclareStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Consts       []Node
	Stmt         Node
	Alt          bool
}

DeclareStmt is a `declare ($Consts...) $Stmt` statement. $Stmt can be an empty statement, like in `declare ($Consts...);`, but it can also be a block like in `declare ($Consts...) {}`. If $Alt is true, the block will begin with `:` and end with `enddeclare`. Every element in $Consts is a *ConstantStmt.

func (*DeclareStmt) GetFreeFloating

func (n *DeclareStmt) GetFreeFloating() *freefloating.Collection

func (*DeclareStmt) Walk

func (n *DeclareStmt) Walk(v Visitor)

type DefaultStmt

type DefaultStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Stmts        []Node
}

DefaultStmt is a `default: $Stmts...` statement.

func (*DefaultStmt) GetFreeFloating

func (n *DefaultStmt) GetFreeFloating() *freefloating.Collection

func (*DefaultStmt) Walk

func (n *DefaultStmt) Walk(v Visitor)

type DivExpr

type DivExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

DivExpr is a `$Left / $Right` expression.

func (*DivExpr) GetFreeFloating

func (n *DivExpr) GetFreeFloating() *freefloating.Collection

func (*DivExpr) Walk

func (n *DivExpr) Walk(v Visitor)

type Dnumber

type Dnumber struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
}

Dnumber is a floating point literal.

func (*Dnumber) GetFreeFloating

func (n *Dnumber) GetFreeFloating() *freefloating.Collection

func (*Dnumber) Walk

func (n *Dnumber) Walk(v Visitor)

type DoStmt

type DoStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Stmt         Node
	Cond         Node
}

DoStmt is a `do $Stmt while ($Cond)` statement.

func (*DoStmt) GetFreeFloating

func (n *DoStmt) GetFreeFloating() *freefloating.Collection

func (*DoStmt) Walk

func (n *DoStmt) Walk(v Visitor)

type EchoStmt

type EchoStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Exprs        []Node
}

EchoStmt is a `echo $Exprs...` statement.

func (*EchoStmt) GetFreeFloating

func (n *EchoStmt) GetFreeFloating() *freefloating.Collection

func (*EchoStmt) Walk

func (n *EchoStmt) Walk(v Visitor)

type ElseIfStmt

type ElseIfStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Cond         Node
	Stmt         Node
	AltSyntax    bool
	Merged       bool
}

ElseIfStmt is a `elseif ($Cond) $Stmt` statement. If $AltSyntax is true, the block will begin with `:` and end with `endif`. $Merged tells whether this elseif is a merged `else if` statement.

func (*ElseIfStmt) GetFreeFloating

func (n *ElseIfStmt) GetFreeFloating() *freefloating.Collection

func (*ElseIfStmt) Walk

func (n *ElseIfStmt) Walk(v Visitor)

type ElseStmt

type ElseStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Stmt         Node
	AltSyntax    bool
}

ElseStmt is a `else $Stmt` statement. If $AltSyntax is true, the block will begin with `:`.

func (*ElseStmt) GetFreeFloating

func (n *ElseStmt) GetFreeFloating() *freefloating.Collection

func (*ElseStmt) Walk

func (n *ElseStmt) Walk(v Visitor)

type EmptyExpr

type EmptyExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

EmptyExpr is a `empty($Expr)` expression.

func (*EmptyExpr) GetFreeFloating

func (n *EmptyExpr) GetFreeFloating() *freefloating.Collection

func (*EmptyExpr) Walk

func (n *EmptyExpr) Walk(v Visitor)

type Encapsed

type Encapsed struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Parts        []Node
}

Encapsed is a string literal with interpolated parts.

func (*Encapsed) GetFreeFloating

func (n *Encapsed) GetFreeFloating() *freefloating.Collection

func (*Encapsed) Walk

func (n *Encapsed) Walk(v Visitor)

type EncapsedStringPart

type EncapsedStringPart struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
}

EncapsedStringPart is a part of the Encapsed literal.

func (*EncapsedStringPart) GetFreeFloating

func (n *EncapsedStringPart) GetFreeFloating() *freefloating.Collection

func (*EncapsedStringPart) Walk

func (n *EncapsedStringPart) Walk(v Visitor)

type EqualExpr

type EqualExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

EqualExpr is a `$Left == $Right` expression.

func (*EqualExpr) GetFreeFloating

func (n *EqualExpr) GetFreeFloating() *freefloating.Collection

func (*EqualExpr) Walk

func (n *EqualExpr) Walk(v Visitor)

type ErrorSuppressExpr

type ErrorSuppressExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

ErrorSuppressExpr is a `@$Expr` expression.

func (*ErrorSuppressExpr) GetFreeFloating

func (n *ErrorSuppressExpr) GetFreeFloating() *freefloating.Collection

func (*ErrorSuppressExpr) Walk

func (n *ErrorSuppressExpr) Walk(v Visitor)

type EvalExpr

type EvalExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

EvalExpr is a `eval($Expr)` expression.

func (*EvalExpr) GetFreeFloating

func (n *EvalExpr) GetFreeFloating() *freefloating.Collection

func (*EvalExpr) Walk

func (n *EvalExpr) Walk(v Visitor)

type ExitExpr

type ExitExpr struct {
	FreeFloating freefloating.Collection
	Die          bool
	Position     *position.Position
	Expr         Node
}

ExitExpr is a `exit($Expr)` expression. If $Die is true, it's `die($Expr)`.

func (*ExitExpr) GetFreeFloating

func (n *ExitExpr) GetFreeFloating() *freefloating.Collection

func (*ExitExpr) Walk

func (n *ExitExpr) Walk(v Visitor)

type ExpressionStmt

type ExpressionStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

ExpressionStmt is an expression $Expr that is evaluated for side-effects only. When expression is used in a place where statement is expected, it becomes an ExpressionStmt.

func (*ExpressionStmt) GetFreeFloating

func (n *ExpressionStmt) GetFreeFloating() *freefloating.Collection

func (*ExpressionStmt) Walk

func (n *ExpressionStmt) Walk(v Visitor)

type FinallyStmt

type FinallyStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Stmts        []Node
}

FinallyStmt is a `finally { $Stmts... }` statement.

func (*FinallyStmt) GetFreeFloating

func (n *FinallyStmt) GetFreeFloating() *freefloating.Collection

func (*FinallyStmt) Walk

func (n *FinallyStmt) Walk(v Visitor)

type ForStmt

type ForStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Init         []Node
	Cond         []Node
	Loop         []Node
	Stmt         Node
	AltSyntax    bool
}

ForStmt is a `for ($Init; $Cond; $Loop) $Stmt` statement. If $AltSyntax is true, the block will begin with `:` and end with `endfor`.

func (*ForStmt) GetFreeFloating

func (n *ForStmt) GetFreeFloating() *freefloating.Collection

func (*ForStmt) Walk

func (n *ForStmt) Walk(v Visitor)

type ForeachStmt

type ForeachStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
	Key          Node
	Variable     Node
	Stmt         Node
	AltSyntax    bool
}

ForeachStmt is a `foreach ($Expr as $Key => $Variable) $Stmt` statement. If $AltSyntax is true, the block will begin with `:` and end with `endforeach`.

func (*ForeachStmt) GetFreeFloating

func (n *ForeachStmt) GetFreeFloating() *freefloating.Collection

func (*ForeachStmt) Walk

func (n *ForeachStmt) Walk(v Visitor)

type FunctionCallExpr

type FunctionCallExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Function     Node

	ArgsFreeFloating freefloating.Collection
	Args             []Node
}

FunctionCallExpr is a `$Function($Args...)` expression.

func (*FunctionCallExpr) Arg

func (n *FunctionCallExpr) Arg(i int) *Argument

Arg returns the ith argument.

func (*FunctionCallExpr) GetFreeFloating

func (n *FunctionCallExpr) GetFreeFloating() *freefloating.Collection

func (*FunctionCallExpr) Walk

func (n *FunctionCallExpr) Walk(v Visitor)

type FunctionStmt

type FunctionStmt struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	ReturnsRef    bool
	PhpDocComment string
	PhpDoc        []phpdoc.CommentPart
	FunctionName  *Identifier
	Params        []Node
	ReturnType    Node
	Stmts         []Node
}

FunctionStmt is a named function declaration.

func (*FunctionStmt) GetFreeFloating

func (n *FunctionStmt) GetFreeFloating() *freefloating.Collection

func (*FunctionStmt) Walk

func (n *FunctionStmt) Walk(v Visitor)

type GlobalStmt

type GlobalStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Vars         []Node
}

GlobalStmt is a `global $Vars` statement.

func (*GlobalStmt) GetFreeFloating

func (n *GlobalStmt) GetFreeFloating() *freefloating.Collection

func (*GlobalStmt) Walk

func (n *GlobalStmt) Walk(v Visitor)

type GotoStmt

type GotoStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Label        *Identifier
}

GotoStmt is a `goto $Label` statement.

func (*GotoStmt) GetFreeFloating

func (n *GotoStmt) GetFreeFloating() *freefloating.Collection

func (*GotoStmt) Walk

func (n *GotoStmt) Walk(v Visitor)

type GreaterExpr

type GreaterExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

GreaterExpr is a `$Left > $Right` expression.

func (*GreaterExpr) GetFreeFloating

func (n *GreaterExpr) GetFreeFloating() *freefloating.Collection

func (*GreaterExpr) Walk

func (n *GreaterExpr) Walk(v Visitor)

type GreaterOrEqualExpr

type GreaterOrEqualExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

GreaterOrEqualExpr is a `$Left >= $Right` expression.

func (*GreaterOrEqualExpr) GetFreeFloating

func (n *GreaterOrEqualExpr) GetFreeFloating() *freefloating.Collection

func (*GreaterOrEqualExpr) Walk

func (n *GreaterOrEqualExpr) Walk(v Visitor)

type GroupUseStmt

type GroupUseStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	UseType      *Identifier
	Prefix       *Name
	UseList      []Node
}

GroupUseStmt is a `use $UseType $Prefix\{ $UseList }` statement. $UseType is a "function" or "const". TODO: change $UseType type to *Identifier?

func (*GroupUseStmt) GetFreeFloating

func (n *GroupUseStmt) GetFreeFloating() *freefloating.Collection

func (*GroupUseStmt) Walk

func (n *GroupUseStmt) Walk(v Visitor)

type HaltCompilerStmt

type HaltCompilerStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
}

HaltCompilerStmt is a `__halt_compiler()` statement.

func (*HaltCompilerStmt) GetFreeFloating

func (n *HaltCompilerStmt) GetFreeFloating() *freefloating.Collection

func (*HaltCompilerStmt) Walk

func (n *HaltCompilerStmt) Walk(v Visitor)

type Heredoc

type Heredoc struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Label        string
	Parts        []Node
}

Heredoc is special PHP literal. Note that it may be a nowdoc, depending on the label.

func (*Heredoc) GetFreeFloating

func (n *Heredoc) GetFreeFloating() *freefloating.Collection

func (*Heredoc) Walk

func (n *Heredoc) Walk(v Visitor)

type IdenticalExpr

type IdenticalExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

IdenticalExpr is a `$Left === $Right` expression.

func (*IdenticalExpr) GetFreeFloating

func (n *IdenticalExpr) GetFreeFloating() *freefloating.Collection

func (*IdenticalExpr) Walk

func (n *IdenticalExpr) Walk(v Visitor)

type Identifier

type Identifier struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
}

Identifier is like a name, but it's always resolved to itself. Identifier always consists of a single part.

func (*Identifier) GetFreeFloating

func (n *Identifier) GetFreeFloating() *freefloating.Collection

func (*Identifier) Walk

func (n *Identifier) Walk(v Visitor)

type IfStmt

type IfStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Cond         Node
	Stmt         Node
	ElseIf       []Node
	Else         Node
	AltSyntax    bool
}

IfStmt is a `if ($Cond) $Stmt` statement. $ElseIf contains an entire elseif chain, if any. $Else may contain an else part of the statement.

func (*IfStmt) GetFreeFloating

func (n *IfStmt) GetFreeFloating() *freefloating.Collection

func (*IfStmt) Walk

func (n *IfStmt) Walk(v Visitor)

type ImportExpr

type ImportExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Func         string // "include" "include_once" "require" "require_once"
	Expr         Node
}

ImportExpr is a `$Func $Expr` expression. It could be `include $Expr`, `require $Expr` and so on.

func (*ImportExpr) GetFreeFloating

func (n *ImportExpr) GetFreeFloating() *freefloating.Collection

func (*ImportExpr) Walk

func (n *ImportExpr) Walk(v Visitor)

type InlineHTMLStmt

type InlineHTMLStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
}

InlineHTMLStmt is a part of the script that will not be interpreted as a PHP script. In other words, it's everything outside of the <? and ?> tags.

func (*InlineHTMLStmt) GetFreeFloating

func (n *InlineHTMLStmt) GetFreeFloating() *freefloating.Collection

func (*InlineHTMLStmt) Walk

func (n *InlineHTMLStmt) Walk(v Visitor)

type InstanceOfExpr

type InstanceOfExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
	Class        Node
}

InstanceOfExpr is a `$Expr instanceof $Class` expression.

func (*InstanceOfExpr) GetFreeFloating

func (n *InstanceOfExpr) GetFreeFloating() *freefloating.Collection

func (*InstanceOfExpr) Walk

func (n *InstanceOfExpr) Walk(v Visitor)

type InterfaceExtendsStmt

type InterfaceExtendsStmt struct {
	FreeFloating   freefloating.Collection
	Position       *position.Position
	InterfaceNames []Node
}

InterfaceExtendsStmt is a `extends $InterfaceNames...` statement. TODO: do we need this wrapper node? TODO: InterfaceNames could be a []*Name.

func (*InterfaceExtendsStmt) GetFreeFloating

func (n *InterfaceExtendsStmt) GetFreeFloating() *freefloating.Collection

func (*InterfaceExtendsStmt) Walk

func (n *InterfaceExtendsStmt) Walk(v Visitor)

type InterfaceStmt

type InterfaceStmt struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	PhpDocComment string
	InterfaceName *Identifier
	Extends       *InterfaceExtendsStmt
	Stmts         []Node
}

InterfaceStmt is an interface declaration.

func (*InterfaceStmt) GetFreeFloating

func (n *InterfaceStmt) GetFreeFloating() *freefloating.Collection

func (*InterfaceStmt) Walk

func (n *InterfaceStmt) Walk(v Visitor)

type IssetExpr

type IssetExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variables    []Node
}

IssetExpr is a `isset($Variables...)` expression.

func (*IssetExpr) GetFreeFloating

func (n *IssetExpr) GetFreeFloating() *freefloating.Collection

func (*IssetExpr) Walk

func (n *IssetExpr) Walk(v Visitor)

type LabelStmt

type LabelStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	LabelName    *Identifier
}

LabelStmt is a `$LabelName:` statement.

func (*LabelStmt) GetFreeFloating

func (n *LabelStmt) GetFreeFloating() *freefloating.Collection

func (*LabelStmt) Walk

func (n *LabelStmt) Walk(v Visitor)

type ListExpr

type ListExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Items        []*ArrayItemExpr
	ShortSyntax  bool
}

ListExpr is a `list($Items...)` expression. Note that it may appear not only in assignments as LHS, but also in foreach value expressions.

func (*ListExpr) GetFreeFloating

func (n *ListExpr) GetFreeFloating() *freefloating.Collection

func (*ListExpr) Walk

func (n *ListExpr) Walk(v Visitor)

type Lnumber

type Lnumber struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
}

Lnumber is an integer literal.

func (*Lnumber) GetFreeFloating

func (n *Lnumber) GetFreeFloating() *freefloating.Collection

func (*Lnumber) Walk

func (n *Lnumber) Walk(v Visitor)

type LogicalAndExpr

type LogicalAndExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

LogicalAndExpr is a `$Left and $Right` expression.

func (*LogicalAndExpr) GetFreeFloating

func (n *LogicalAndExpr) GetFreeFloating() *freefloating.Collection

func (*LogicalAndExpr) Walk

func (n *LogicalAndExpr) Walk(v Visitor)

type LogicalOrExpr

type LogicalOrExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

LogicalOrExpr is a `$Left or $Right` expression.

func (*LogicalOrExpr) GetFreeFloating

func (n *LogicalOrExpr) GetFreeFloating() *freefloating.Collection

func (*LogicalOrExpr) Walk

func (n *LogicalOrExpr) Walk(v Visitor)

type LogicalXorExpr

type LogicalXorExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

LogicalXorExpr is a `$Left xor $Right` expression.

func (*LogicalXorExpr) GetFreeFloating

func (n *LogicalXorExpr) GetFreeFloating() *freefloating.Collection

func (*LogicalXorExpr) Walk

func (n *LogicalXorExpr) Walk(v Visitor)

type MagicConstant

type MagicConstant struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
}

MagicConstant is a special PHP constant like __FILE__ or __CLASS__. TODO: do we really need a separate node for these constants?

func (*MagicConstant) GetFreeFloating

func (n *MagicConstant) GetFreeFloating() *freefloating.Collection

func (*MagicConstant) Walk

func (n *MagicConstant) Walk(v Visitor)

type MethodCallExpr

type MethodCallExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Method       Node

	ArgsFreeFloating freefloating.Collection
	Args             []Node
}

MethodCallExpr is a `$Variable->$Method($Args...)` expression.

func (*MethodCallExpr) Arg

func (n *MethodCallExpr) Arg(i int) *Argument

Arg returns the ith argument.

func (*MethodCallExpr) GetFreeFloating

func (n *MethodCallExpr) GetFreeFloating() *freefloating.Collection

func (*MethodCallExpr) Walk

func (n *MethodCallExpr) Walk(v Visitor)

type MinusExpr

type MinusExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

MinusExpr is a `$Left - $Right` expression.

func (*MinusExpr) GetFreeFloating

func (n *MinusExpr) GetFreeFloating() *freefloating.Collection

func (*MinusExpr) Walk

func (n *MinusExpr) Walk(v Visitor)

type ModExpr

type ModExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

ModExpr is a `$Left % $Right` expression.

func (*ModExpr) GetFreeFloating

func (n *ModExpr) GetFreeFloating() *freefloating.Collection

func (*ModExpr) Walk

func (n *ModExpr) Walk(v Visitor)

type MulExpr

type MulExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

MulExpr is a `$Left * $Right` expression.

func (*MulExpr) GetFreeFloating

func (n *MulExpr) GetFreeFloating() *freefloating.Collection

func (*MulExpr) Walk

func (n *MulExpr) Walk(v Visitor)

type Name

type Name struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
}

Name is either a FQN, local name or a name that may need a further resolving. Use Name methods to interpret the $Value correctly.

func (*Name) FirstPart

func (n *Name) FirstPart() string

FirstPart returns only the first name part. If name contains only one part, that part is returned.

func (*Name) GetFreeFloating

func (n *Name) GetFreeFloating() *freefloating.Collection

func (*Name) HeadTail

func (n *Name) HeadTail() (head, tail string)

HeadTail is an efficient way to get <FirstPart, RestParts> pair.

func (*Name) IsFullyQualified

func (n *Name) IsFullyQualified() bool

IsFullyQualified reports whether the name is fully qualified. FQN don't need any further resolution.

func (*Name) LastPart

func (n *Name) LastPart() string

LastPart returns only the last name part. If name contains only one part, that part is returned.

func (*Name) NumParts

func (n *Name) NumParts() int

NumParts reports number of the name parts.

func (*Name) RestParts

func (n *Name) RestParts() string

RestParts returns all but first name parts. If name contains only one part, empty string is returned.

func (*Name) Walk

func (n *Name) Walk(v Visitor)

type NamespaceStmt

type NamespaceStmt struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	NamespaceName *Name
	Stmts         []Node
}

NamespaceStmt is a `namespace $NamespaceName` statement. If $Stmts is not nil, it's `namespace $NamespaceName { $Stmts... }`.

func (*NamespaceStmt) GetFreeFloating

func (n *NamespaceStmt) GetFreeFloating() *freefloating.Collection

func (*NamespaceStmt) Walk

func (n *NamespaceStmt) Walk(v Visitor)

type NewExpr

type NewExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Class        Node

	ArgsFreeFloating freefloating.Collection
	Args             []Node
}

NewExpr is a `new $Class($Args...)` expression. If $Args is nil, it's `new $Class`.

func (*NewExpr) Arg

func (n *NewExpr) Arg(i int) *Argument

Arg returns the ith argument.

func (*NewExpr) GetFreeFloating

func (n *NewExpr) GetFreeFloating() *freefloating.Collection

func (*NewExpr) Walk

func (n *NewExpr) Walk(v Visitor)

type Node

type Node interface {
	Walk(Visitor)
	GetFreeFloating() *freefloating.Collection
}

Node is a type that is implemented by all IR types. node_types.go contains all implementations.

type NodeKind

type NodeKind int
const (
	KindAnonClassExpr NodeKind = iota
	KindArgument
	KindArrayDimFetchExpr
	KindArrayExpr
	KindArrayItemExpr
	KindArrowFunctionExpr
	KindAssign
	KindAssignBitwiseAnd
	KindAssignBitwiseOr
	KindAssignBitwiseXor
	KindAssignCoalesce
	KindAssignConcat
	KindAssignDiv
	KindAssignMinus
	KindAssignMod
	KindAssignMul
	KindAssignPlus
	KindAssignPow
	KindAssignReference
	KindAssignShiftLeft
	KindAssignShiftRight
	KindBadString
	KindBitwiseAndExpr
	KindBitwiseNotExpr
	KindBitwiseOrExpr
	KindBitwiseXorExpr
	KindBooleanAndExpr
	KindBooleanNotExpr
	KindBooleanOrExpr
	KindBreakStmt
	KindCaseListStmt
	KindCaseStmt
	KindCatchStmt
	KindClassConstFetchExpr
	KindClassConstListStmt
	KindClassExtendsStmt
	KindClassImplementsStmt
	KindClassMethodStmt
	KindClassStmt
	KindCloneExpr
	KindClosureExpr
	KindClosureUseExpr
	KindCoalesceExpr
	KindConcatExpr
	KindConstFetchExpr
	KindConstListStmt
	KindConstantStmt
	KindContinueStmt
	KindDeclareStmt
	KindDefaultStmt
	KindDivExpr
	KindDnumber
	KindDoStmt
	KindEchoStmt
	KindElseIfStmt
	KindElseStmt
	KindEmptyExpr
	KindEncapsed
	KindEncapsedStringPart
	KindEqualExpr
	KindErrorSuppressExpr
	KindEvalExpr
	KindExitExpr
	KindExpressionStmt
	KindFinallyStmt
	KindForStmt
	KindForeachStmt
	KindFunctionCallExpr
	KindFunctionStmt
	KindGlobalStmt
	KindGotoStmt
	KindGreaterExpr
	KindGreaterOrEqualExpr
	KindGroupUseStmt
	KindHaltCompilerStmt
	KindHeredoc
	KindIdenticalExpr
	KindIdentifier
	KindIfStmt
	KindImportExpr
	KindInlineHTMLStmt
	KindInstanceOfExpr
	KindInterfaceExtendsStmt
	KindInterfaceStmt
	KindIssetExpr
	KindLabelStmt
	KindListExpr
	KindLnumber
	KindLogicalAndExpr
	KindLogicalOrExpr
	KindLogicalXorExpr
	KindMagicConstant
	KindMethodCallExpr
	KindMinusExpr
	KindModExpr
	KindMulExpr
	KindName
	KindNamespaceStmt
	KindNewExpr
	KindNopStmt
	KindNotEqualExpr
	KindNotIdenticalExpr
	KindNullable
	KindParameter
	KindParenExpr
	KindPlusExpr
	KindPostDecExpr
	KindPostIncExpr
	KindPowExpr
	KindPreDecExpr
	KindPreIncExpr
	KindPrintExpr
	KindPropertyFetchExpr
	KindPropertyListStmt
	KindPropertyStmt
	KindReferenceExpr
	KindReturnStmt
	KindRoot
	KindShellExecExpr
	KindShiftLeftExpr
	KindShiftRightExpr
	KindSimpleVar
	KindSmallerExpr
	KindSmallerOrEqualExpr
	KindSpaceshipExpr
	KindStaticCallExpr
	KindStaticPropertyFetchExpr
	KindStaticStmt
	KindStaticVarStmt
	KindStmtList
	KindString
	KindSwitchStmt
	KindTernaryExpr
	KindThrowStmt
	KindTraitAdaptationListStmt
	KindTraitMethodRefStmt
	KindTraitStmt
	KindTraitUseAliasStmt
	KindTraitUsePrecedenceStmt
	KindTraitUseStmt
	KindTryStmt
	KindTypeCastExpr
	KindUnaryMinusExpr
	KindUnaryPlusExpr
	KindUnsetCastExpr
	KindUnsetStmt
	KindUseListStmt
	KindUseStmt
	KindVar
	KindWhileStmt
	KindYieldExpr
	KindYieldFromExpr

	NumKinds
)

func GetNodeKind

func GetNodeKind(x Node) NodeKind

type NopStmt

type NopStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
}

NopStmt is a `;` statement. It's also known as "empty statement".

func (*NopStmt) GetFreeFloating

func (n *NopStmt) GetFreeFloating() *freefloating.Collection

func (*NopStmt) Walk

func (n *NopStmt) Walk(v Visitor)

type NotEqualExpr

type NotEqualExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

NotEqualExpr is a `$Left != $Right` expression.

func (*NotEqualExpr) GetFreeFloating

func (n *NotEqualExpr) GetFreeFloating() *freefloating.Collection

func (*NotEqualExpr) Walk

func (n *NotEqualExpr) Walk(v Visitor)

type NotIdenticalExpr

type NotIdenticalExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

NotIdenticalExpr is a `$Left !== $Right` expression.

func (*NotIdenticalExpr) GetFreeFloating

func (n *NotIdenticalExpr) GetFreeFloating() *freefloating.Collection

func (*NotIdenticalExpr) Walk

func (n *NotIdenticalExpr) Walk(v Visitor)

type Nullable

type Nullable struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

Nullable is a `?$Expr` expression.

func (*Nullable) GetFreeFloating

func (n *Nullable) GetFreeFloating() *freefloating.Collection

func (*Nullable) Walk

func (n *Nullable) Walk(v Visitor)

type Parameter

type Parameter struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	ByRef        bool
	Variadic     bool
	VariableType Node
	Variable     *SimpleVar
	DefaultValue Node
}

Parameter is a function param declaration. Possible syntaxes: $VariableType $Variable = $DefaultValue $VariableType $Variable $Variable If $ByRef is true, it's `&$Variable`. If $Variadic is true, it's `...$Variable`.

func (*Parameter) GetFreeFloating

func (n *Parameter) GetFreeFloating() *freefloating.Collection

func (*Parameter) Walk

func (n *Parameter) Walk(v Visitor)

type ParenExpr

type ParenExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

ParenExpr is a `($Expr)` expression.

func (*ParenExpr) GetFreeFloating

func (n *ParenExpr) GetFreeFloating() *freefloating.Collection

func (*ParenExpr) Walk

func (n *ParenExpr) Walk(v Visitor)

type PlusExpr

type PlusExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

PlusExpr is a `$Left + $Right` expression.

func (*PlusExpr) GetFreeFloating

func (n *PlusExpr) GetFreeFloating() *freefloating.Collection

func (*PlusExpr) Walk

func (n *PlusExpr) Walk(v Visitor)

type PostDecExpr

type PostDecExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
}

PostDecExpr is a `$Variable--` expression.

func (*PostDecExpr) GetFreeFloating

func (n *PostDecExpr) GetFreeFloating() *freefloating.Collection

func (*PostDecExpr) Walk

func (n *PostDecExpr) Walk(v Visitor)

type PostIncExpr

type PostIncExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
}

PostIncExpr is a `$Variable++` expression.

func (*PostIncExpr) GetFreeFloating

func (n *PostIncExpr) GetFreeFloating() *freefloating.Collection

func (*PostIncExpr) Walk

func (n *PostIncExpr) Walk(v Visitor)

type PowExpr

type PowExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

PowExpr is a `$Left ** $Right` expression.

func (*PowExpr) GetFreeFloating

func (n *PowExpr) GetFreeFloating() *freefloating.Collection

func (*PowExpr) Walk

func (n *PowExpr) Walk(v Visitor)

type PreDecExpr

type PreDecExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
}

PreDecExpr is a `--$Variable` expression.

func (*PreDecExpr) GetFreeFloating

func (n *PreDecExpr) GetFreeFloating() *freefloating.Collection

func (*PreDecExpr) Walk

func (n *PreDecExpr) Walk(v Visitor)

type PreIncExpr

type PreIncExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
}

PreIncExpr is a `++$Variable` expression.

func (*PreIncExpr) GetFreeFloating

func (n *PreIncExpr) GetFreeFloating() *freefloating.Collection

func (*PreIncExpr) Walk

func (n *PreIncExpr) Walk(v Visitor)

type PrintExpr

type PrintExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

PrintExpr is a `print $Expr` expression.

func (*PrintExpr) GetFreeFloating

func (n *PrintExpr) GetFreeFloating() *freefloating.Collection

func (*PrintExpr) Walk

func (n *PrintExpr) Walk(v Visitor)

type PropertyFetchExpr

type PropertyFetchExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
	Property     Node
}

PropertyFetchExpr is a `$Variable->$Property` expression.

func (*PropertyFetchExpr) GetFreeFloating

func (n *PropertyFetchExpr) GetFreeFloating() *freefloating.Collection

func (*PropertyFetchExpr) Walk

func (n *PropertyFetchExpr) Walk(v Visitor)

type PropertyListStmt

type PropertyListStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Modifiers    []*Identifier
	Type         Node
	Properties   []Node
}

PropertyListStmt is a `$Modifiers $Type $Properties` statement. Every element in $Properties is a *PropertyStmt.

func (*PropertyListStmt) GetFreeFloating

func (n *PropertyListStmt) GetFreeFloating() *freefloating.Collection

func (*PropertyListStmt) Walk

func (n *PropertyListStmt) Walk(v Visitor)

type PropertyStmt

type PropertyStmt struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	PhpDocComment string
	PhpDoc        []phpdoc.CommentPart
	Variable      *SimpleVar
	Expr          Node
}

PropertyStmt is a `$Variable = $Expr` statement. It's a part of the *PropertyListStmt.

func (*PropertyStmt) GetFreeFloating

func (n *PropertyStmt) GetFreeFloating() *freefloating.Collection

func (*PropertyStmt) Walk

func (n *PropertyStmt) Walk(v Visitor)

type ReferenceExpr

type ReferenceExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     Node
}

ReferenceExpr is a `&$Variable` expression.

func (*ReferenceExpr) GetFreeFloating

func (n *ReferenceExpr) GetFreeFloating() *freefloating.Collection

func (*ReferenceExpr) Walk

func (n *ReferenceExpr) Walk(v Visitor)

type ReturnStmt

type ReturnStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

ReturnStmt is a `return $Expr` statement.

func (*ReturnStmt) GetFreeFloating

func (n *ReturnStmt) GetFreeFloating() *freefloating.Collection

func (*ReturnStmt) Walk

func (n *ReturnStmt) Walk(v Visitor)

type Root

type Root struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Stmts        []Node
}

Root is a node that wraps all file statements.

func (*Root) GetFreeFloating

func (n *Root) GetFreeFloating() *freefloating.Collection

func (*Root) Walk

func (n *Root) Walk(v Visitor)

type ShellExecExpr

type ShellExecExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Parts        []Node
}

ShellExecExpr is a “-quoted string.

func (*ShellExecExpr) GetFreeFloating

func (n *ShellExecExpr) GetFreeFloating() *freefloating.Collection

func (*ShellExecExpr) Walk

func (n *ShellExecExpr) Walk(v Visitor)

type ShiftLeftExpr

type ShiftLeftExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

ShiftLeftExpr is a `$Left << $Right` expression.

func (*ShiftLeftExpr) GetFreeFloating

func (n *ShiftLeftExpr) GetFreeFloating() *freefloating.Collection

func (*ShiftLeftExpr) Walk

func (n *ShiftLeftExpr) Walk(v Visitor)

type ShiftRightExpr

type ShiftRightExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

ShiftRightExpr is a `$Left >> $Right` expression.

func (*ShiftRightExpr) GetFreeFloating

func (n *ShiftRightExpr) GetFreeFloating() *freefloating.Collection

func (*ShiftRightExpr) Walk

func (n *ShiftRightExpr) Walk(v Visitor)

type SimpleVar

type SimpleVar struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Name         string
}

SimpleVar is a normal PHP variable like `$foo` or `$bar`.

func (*SimpleVar) GetFreeFloating

func (n *SimpleVar) GetFreeFloating() *freefloating.Collection

func (*SimpleVar) Walk

func (n *SimpleVar) Walk(v Visitor)

type SmallerExpr

type SmallerExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

SmallerExpr is a `$Left < $Right` expression.

func (*SmallerExpr) GetFreeFloating

func (n *SmallerExpr) GetFreeFloating() *freefloating.Collection

func (*SmallerExpr) Walk

func (n *SmallerExpr) Walk(v Visitor)

type SmallerOrEqualExpr

type SmallerOrEqualExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

SmallerOrEqualExpr is a `$Left <= $Right` expression.

func (*SmallerOrEqualExpr) GetFreeFloating

func (n *SmallerOrEqualExpr) GetFreeFloating() *freefloating.Collection

func (*SmallerOrEqualExpr) Walk

func (n *SmallerOrEqualExpr) Walk(v Visitor)

type SpaceshipExpr

type SpaceshipExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Left         Node
	Right        Node
}

SpaceshipExpr is a `$Left <=> $Right` expression.

func (*SpaceshipExpr) GetFreeFloating

func (n *SpaceshipExpr) GetFreeFloating() *freefloating.Collection

func (*SpaceshipExpr) Walk

func (n *SpaceshipExpr) Walk(v Visitor)

type StaticCallExpr

type StaticCallExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Class        Node
	Call         Node

	ArgsFreeFloating freefloating.Collection
	Args             []Node
}

StaticCallExpr is a `$Class::$Call($Args...)` expression.

func (*StaticCallExpr) Arg

func (n *StaticCallExpr) Arg(i int) *Argument

Arg returns the ith argument.

func (*StaticCallExpr) GetFreeFloating

func (n *StaticCallExpr) GetFreeFloating() *freefloating.Collection

func (*StaticCallExpr) Walk

func (n *StaticCallExpr) Walk(v Visitor)

type StaticPropertyFetchExpr

type StaticPropertyFetchExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Class        Node
	Property     Node
}

StaticPropertyFetchExpr is a `$Class::$Property` expression.

func (*StaticPropertyFetchExpr) GetFreeFloating

func (n *StaticPropertyFetchExpr) GetFreeFloating() *freefloating.Collection

func (*StaticPropertyFetchExpr) Walk

func (n *StaticPropertyFetchExpr) Walk(v Visitor)

type StaticStmt

type StaticStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Vars         []Node
}

StaticStmt is a `static $Vars...` statement. Every element in $Vars is a *StaticVarStmt.

func (*StaticStmt) GetFreeFloating

func (n *StaticStmt) GetFreeFloating() *freefloating.Collection

func (*StaticStmt) Walk

func (n *StaticStmt) Walk(v Visitor)

type StaticVarStmt

type StaticVarStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Variable     *SimpleVar
	Expr         Node
}

StaticVarStmt is a `$Variable = $Expr`. It's a part of the *StaticStmt.

func (*StaticVarStmt) GetFreeFloating

func (n *StaticVarStmt) GetFreeFloating() *freefloating.Collection

func (*StaticVarStmt) Walk

func (n *StaticVarStmt) Walk(v Visitor)

type StmtList

type StmtList struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Stmts        []Node
}

StmtList is a `{ $Stmts... }` statement. It's also known as "block statement".

func (*StmtList) GetFreeFloating

func (n *StmtList) GetFreeFloating() *freefloating.Collection

func (*StmtList) Walk

func (n *StmtList) Walk(v Visitor)

type String

type String struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Value        string
	DoubleQuotes bool
}

String is a simple (no interpolation) string literal.

The $Value contains interpreted string bytes, if you need a raw string value, use positions and fetch relevant the source bytes.

$DoubleQuotes tell whether originally this string literal was ""-quoted.

func (*String) GetFreeFloating

func (n *String) GetFreeFloating() *freefloating.Collection

func (*String) Walk

func (n *String) Walk(v Visitor)

type SwitchStmt

type SwitchStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Cond         Node
	CaseList     *CaseListStmt
	AltSyntax    bool
}

SwitchStmt is a `switch ($Cond) $CaseList` statement. If $AltSyntax is true, the block will begin with `:` and end with `endswitch`.

func (*SwitchStmt) GetFreeFloating

func (n *SwitchStmt) GetFreeFloating() *freefloating.Collection

func (*SwitchStmt) Walk

func (n *SwitchStmt) Walk(v Visitor)

type TernaryExpr

type TernaryExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Condition    Node
	IfTrue       Node
	IfFalse      Node
}

TernaryExpr is a `$Condition ? $IfTrue : $IfFalse` expression. If $IfTrue is nil, it's `$Condition ?: $IfFalse`.

func (*TernaryExpr) GetFreeFloating

func (n *TernaryExpr) GetFreeFloating() *freefloating.Collection

func (*TernaryExpr) Walk

func (n *TernaryExpr) Walk(v Visitor)

type ThrowStmt

type ThrowStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

ThrowStmt is a `throw $Expr` statement.

func (*ThrowStmt) GetFreeFloating

func (n *ThrowStmt) GetFreeFloating() *freefloating.Collection

func (*ThrowStmt) Walk

func (n *ThrowStmt) Walk(v Visitor)

type TraitAdaptationListStmt

type TraitAdaptationListStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Adaptations  []Node
}

TraitAdaptationListStmt is a block inside a *TraitUseStmt.

func (*TraitAdaptationListStmt) GetFreeFloating

func (n *TraitAdaptationListStmt) GetFreeFloating() *freefloating.Collection

func (*TraitAdaptationListStmt) Walk

func (n *TraitAdaptationListStmt) Walk(v Visitor)

type TraitMethodRefStmt

type TraitMethodRefStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Trait        Node
	Method       *Identifier
}

func (*TraitMethodRefStmt) GetFreeFloating

func (n *TraitMethodRefStmt) GetFreeFloating() *freefloating.Collection

func (*TraitMethodRefStmt) Walk

func (n *TraitMethodRefStmt) Walk(v Visitor)

type TraitStmt

type TraitStmt struct {
	FreeFloating  freefloating.Collection
	Position      *position.Position
	PhpDocComment string
	TraitName     *Identifier
	Stmts         []Node
}

TraitStmt is a trait declaration.

func (*TraitStmt) GetFreeFloating

func (n *TraitStmt) GetFreeFloating() *freefloating.Collection

func (*TraitStmt) Walk

func (n *TraitStmt) Walk(v Visitor)

type TraitUseAliasStmt

type TraitUseAliasStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Ref          Node
	Modifier     Node
	Alias        *Identifier
}

func (*TraitUseAliasStmt) GetFreeFloating

func (n *TraitUseAliasStmt) GetFreeFloating() *freefloating.Collection

func (*TraitUseAliasStmt) Walk

func (n *TraitUseAliasStmt) Walk(v Visitor)

type TraitUsePrecedenceStmt

type TraitUsePrecedenceStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Ref          Node
	Insteadof    []Node
}

func (*TraitUsePrecedenceStmt) GetFreeFloating

func (n *TraitUsePrecedenceStmt) GetFreeFloating() *freefloating.Collection

func (*TraitUsePrecedenceStmt) Walk

func (n *TraitUsePrecedenceStmt) Walk(v Visitor)

type TraitUseStmt

type TraitUseStmt struct {
	FreeFloating        freefloating.Collection
	Position            *position.Position
	Traits              []Node
	TraitAdaptationList Node
}

func (*TraitUseStmt) GetFreeFloating

func (n *TraitUseStmt) GetFreeFloating() *freefloating.Collection

func (*TraitUseStmt) Walk

func (n *TraitUseStmt) Walk(v Visitor)

type TryStmt

type TryStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Stmts        []Node
	Catches      []Node
	Finally      Node
}

TryStmt is a `try { $Stmts... } $Catches` statement. $Finally only presents if `finally {...}` block exists.

func (*TryStmt) GetFreeFloating

func (n *TryStmt) GetFreeFloating() *freefloating.Collection

func (*TryStmt) Walk

func (n *TryStmt) Walk(v Visitor)

type TypeCastExpr

type TypeCastExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Type         string // "array" "bool" "int" "float" "object" "string"
	Expr         Node
}

TypeCastExpr is a `($Type)$Expr` expression.

func (*TypeCastExpr) GetFreeFloating

func (n *TypeCastExpr) GetFreeFloating() *freefloating.Collection

func (*TypeCastExpr) Walk

func (n *TypeCastExpr) Walk(v Visitor)

type UnaryMinusExpr

type UnaryMinusExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

UnaryMinusExpr is a `-$Expr` expression.

func (*UnaryMinusExpr) GetFreeFloating

func (n *UnaryMinusExpr) GetFreeFloating() *freefloating.Collection

func (*UnaryMinusExpr) Walk

func (n *UnaryMinusExpr) Walk(v Visitor)

type UnaryPlusExpr

type UnaryPlusExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

UnaryPlusExpr is a `+$Expr` expression.

func (*UnaryPlusExpr) GetFreeFloating

func (n *UnaryPlusExpr) GetFreeFloating() *freefloating.Collection

func (*UnaryPlusExpr) Walk

func (n *UnaryPlusExpr) Walk(v Visitor)

type UnsetCastExpr

type UnsetCastExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

UnsetCastExpr is a `(unset)$Expr` expression.

func (*UnsetCastExpr) GetFreeFloating

func (n *UnsetCastExpr) GetFreeFloating() *freefloating.Collection

func (*UnsetCastExpr) Walk

func (n *UnsetCastExpr) Walk(v Visitor)

type UnsetStmt

type UnsetStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Vars         []Node
}

UnsetStmt is a `unset($Vars...)` statement.

func (*UnsetStmt) GetFreeFloating

func (n *UnsetStmt) GetFreeFloating() *freefloating.Collection

func (*UnsetStmt) Walk

func (n *UnsetStmt) Walk(v Visitor)

type UseListStmt

type UseListStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	UseType      *Identifier
	Uses         []Node
}

func (*UseListStmt) GetFreeFloating

func (n *UseListStmt) GetFreeFloating() *freefloating.Collection

func (*UseListStmt) Walk

func (n *UseListStmt) Walk(v Visitor)

type UseStmt

type UseStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	UseType      *Identifier
	Use          *Name
	Alias        *Identifier
}

func (*UseStmt) GetFreeFloating

func (n *UseStmt) GetFreeFloating() *freefloating.Collection

func (*UseStmt) Walk

func (n *UseStmt) Walk(v Visitor)

type Var

type Var struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

Var is variable variable expression like `$$foo` or `${"foo"}`.

func (*Var) GetFreeFloating

func (n *Var) GetFreeFloating() *freefloating.Collection

func (*Var) Walk

func (n *Var) Walk(v Visitor)

type Visitor

type Visitor interface {
	EnterNode(Node) bool
	LeaveNode(Node)
}

Visitor is an interface for basic IR nodes traversal.

type WhileStmt

type WhileStmt struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Cond         Node
	Stmt         Node
	AltSyntax    bool
}

WhileStmt is a `while ($Cond) $Stmt` statement. If $AltSyntax is true, the block will begin with `:` and end with `endwhile`.

func (*WhileStmt) GetFreeFloating

func (n *WhileStmt) GetFreeFloating() *freefloating.Collection

func (*WhileStmt) Walk

func (n *WhileStmt) Walk(v Visitor)

type YieldExpr

type YieldExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Key          Node
	Value        Node
}

YieldExpr is a `yield $Key => $Value` expression. If $Key is nil, it's `yield $Value`.

func (*YieldExpr) GetFreeFloating

func (n *YieldExpr) GetFreeFloating() *freefloating.Collection

func (*YieldExpr) Walk

func (n *YieldExpr) Walk(v Visitor)

type YieldFromExpr

type YieldFromExpr struct {
	FreeFloating freefloating.Collection
	Position     *position.Position
	Expr         Node
}

YieldFromExpr is a `yield from $Expr` expression.

func (*YieldFromExpr) GetFreeFloating

func (n *YieldFromExpr) GetFreeFloating() *freefloating.Collection

func (*YieldFromExpr) Walk

func (n *YieldFromExpr) Walk(v Visitor)

Directories

Path Synopsis
Code generated by the `ir/codegen` package.
Code generated by the `ir/codegen` package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL