php-parser/pkg/ast/node.go

1542 lines
34 KiB
Go
Raw Permalink Normal View History

2020-03-12 22:20:48 +00:00
package ast
import (
2023-12-09 21:36:19 +00:00
"git.maride.cc/maride/php-parser/pkg/position"
"git.maride.cc/maride/php-parser/pkg/token"
2020-03-12 22:20:48 +00:00
)
//go:generate go run node_funcs_gen.go
2020-03-12 22:20:48 +00:00
// Root node
type Root struct {
Position *position.Position
Stmts []Vertex
EndTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// Nullable node is ?Expr
2020-03-12 22:20:48 +00:00
type Nullable struct {
Position *position.Position
QuestionTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// Union node is Expr|Expr1|...
type Union struct {
Position *position.Position
Types []Vertex
SeparatorTkns []*token.Token
}
// Intersection node is Expr&Expr1&...
type Intersection struct {
Position *position.Position
Types []Vertex
SeparatorTkns []*token.Token
}
2020-03-12 22:20:48 +00:00
// Parameter node
type Parameter struct {
Position *position.Position
AttrGroups []Vertex
2021-07-31 15:00:21 +00:00
Modifiers []Vertex
2020-03-12 22:20:48 +00:00
Type Vertex
AmpersandTkn *token.Token
VariadicTkn *token.Token
2020-03-12 22:20:48 +00:00
Var Vertex
EqualTkn *token.Token
2020-03-12 22:20:48 +00:00
DefaultValue Vertex
}
// Identifier node
type Identifier struct {
Position *position.Position
IdentifierTkn *token.Token
Value []byte
2020-03-12 22:20:48 +00:00
}
// Argument node
type Argument struct {
Position *position.Position
Name Vertex
ColonTkn *token.Token
VariadicTkn *token.Token
AmpersandTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// Attribute node
type Attribute struct {
Position *position.Position
Name Vertex
OpenParenthesisTkn *token.Token
Args []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
}
// AttributeGroup node
type AttributeGroup struct {
Position *position.Position
OpenAttributeTkn *token.Token
Attrs []Vertex
SeparatorTkns []*token.Token
CloseAttributeTkn *token.Token
}
2020-03-12 22:20:48 +00:00
// ScalarDnumber node
type ScalarDnumber struct {
Position *position.Position
NumberTkn *token.Token
Value []byte
2020-03-12 22:20:48 +00:00
}
// ScalarEncapsed node
type ScalarEncapsed struct {
2020-12-11 15:29:22 +00:00
Position *position.Position
OpenQuoteTkn *token.Token
Parts []Vertex
CloseQuoteTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ScalarEncapsedStringPart node
type ScalarEncapsedStringPart struct {
Position *position.Position
EncapsedStrTkn *token.Token
Value []byte
2020-03-12 22:20:48 +00:00
}
// ScalarEncapsedStringVar node
type ScalarEncapsedStringVar struct {
Position *position.Position
DollarOpenCurlyBracketTkn *token.Token
2020-12-28 21:01:02 +00:00
Name Vertex
OpenSquareBracketTkn *token.Token
Dim Vertex
CloseSquareBracketTkn *token.Token
CloseCurlyBracketTkn *token.Token
}
// ScalarEncapsedStringVar node
type ScalarEncapsedStringBrackets struct {
Position *position.Position
OpenCurlyBracketTkn *token.Token
Var Vertex
CloseCurlyBracketTkn *token.Token
}
2020-03-12 22:20:48 +00:00
// ScalarHeredoc node
type ScalarHeredoc struct {
Position *position.Position
OpenHeredocTkn *token.Token
Parts []Vertex
CloseHeredocTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ScalarLnumber node
type ScalarLnumber struct {
Position *position.Position
NumberTkn *token.Token
Value []byte
2020-03-12 22:20:48 +00:00
}
// ScalarMagicConstant node
type ScalarMagicConstant struct {
Position *position.Position
MagicConstTkn *token.Token
Value []byte
2020-03-12 22:20:48 +00:00
}
// ScalarString node
type ScalarString struct {
Position *position.Position
MinusTkn *token.Token
StringTkn *token.Token
Value []byte
2020-03-12 22:20:48 +00:00
}
// StmtBreak node
type StmtBreak struct {
Position *position.Position
BreakTkn *token.Token
Expr Vertex
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtCase node
type StmtCase struct {
Position *position.Position
CaseTkn *token.Token
Cond Vertex
CaseSeparatorTkn *token.Token
Stmts []Vertex
2020-03-12 22:20:48 +00:00
}
// StmtCatch node
type StmtCatch struct {
Position *position.Position
CatchTkn *token.Token
OpenParenthesisTkn *token.Token
Types []Vertex
SeparatorTkns []*token.Token
Var Vertex
CloseParenthesisTkn *token.Token
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
2021-07-31 16:44:09 +00:00
// StmtEnum node
type StmtEnum struct {
Position *position.Position
AttrGroups []Vertex
EnumTkn *token.Token
Name Vertex
ColonTkn *token.Token
Type Vertex
ImplementsTkn *token.Token
Implements []Vertex
ImplementsSeparatorTkns []*token.Token
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
}
// EnumCase node
type EnumCase struct {
Position *position.Position
AttrGroups []Vertex
CaseTkn *token.Token
Name Vertex
EqualTkn *token.Token
Expr Vertex
SemiColonTkn *token.Token
}
2020-03-12 22:20:48 +00:00
// StmtClass node
type StmtClass struct {
Position *position.Position
AttrGroups []Vertex
Modifiers []Vertex
ClassTkn *token.Token
2020-12-28 21:01:02 +00:00
Name Vertex
OpenParenthesisTkn *token.Token
2020-12-28 21:01:02 +00:00
Args []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
ExtendsTkn *token.Token
Extends Vertex
ImplementsTkn *token.Token
Implements []Vertex
ImplementsSeparatorTkns []*token.Token
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtClassConstList node
type StmtClassConstList struct {
Position *position.Position
AttrGroups []Vertex
Modifiers []Vertex
ConstTkn *token.Token
Consts []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtClassMethod node
type StmtClassMethod struct {
Position *position.Position
AttrGroups []Vertex
Modifiers []Vertex
FunctionTkn *token.Token
AmpersandTkn *token.Token
2020-12-28 21:01:02 +00:00
Name Vertex
OpenParenthesisTkn *token.Token
Params []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
ReturnType Vertex
Stmt Vertex
2020-03-12 22:20:48 +00:00
}
// StmtConstList node
type StmtConstList struct {
Position *position.Position
ConstTkn *token.Token
Consts []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtConstant node
type StmtConstant struct {
Position *position.Position
Name Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// StmtContinue node
type StmtContinue struct {
Position *position.Position
ContinueTkn *token.Token
Expr Vertex
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtDeclare node
type StmtDeclare struct {
Position *position.Position
DeclareTkn *token.Token
OpenParenthesisTkn *token.Token
Consts []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
Stmt Vertex
EndDeclareTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtDefault node
type StmtDefault struct {
Position *position.Position
DefaultTkn *token.Token
CaseSeparatorTkn *token.Token
Stmts []Vertex
2020-03-12 22:20:48 +00:00
}
// StmtDo node
type StmtDo struct {
Position *position.Position
DoTkn *token.Token
Stmt Vertex
WhileTkn *token.Token
OpenParenthesisTkn *token.Token
Cond Vertex
CloseParenthesisTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtEcho node
type StmtEcho struct {
Position *position.Position
EchoTkn *token.Token
Exprs []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtElse node
type StmtElse struct {
Position *position.Position
ElseTkn *token.Token
ColonTkn *token.Token
Stmt Vertex
2020-03-12 22:20:48 +00:00
}
// StmtElseIf node
type StmtElseIf struct {
Position *position.Position
ElseIfTkn *token.Token
OpenParenthesisTkn *token.Token
Cond Vertex
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
Stmt Vertex
2020-03-12 22:20:48 +00:00
}
// StmtExpression node
type StmtExpression struct {
Position *position.Position
Expr Vertex
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtFinally node
type StmtFinally struct {
Position *position.Position
FinallyTkn *token.Token
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtFor node
type StmtFor struct {
Position *position.Position
ForTkn *token.Token
OpenParenthesisTkn *token.Token
Init []Vertex
InitSeparatorTkns []*token.Token
InitSemiColonTkn *token.Token
Cond []Vertex
CondSeparatorTkns []*token.Token
CondSemiColonTkn *token.Token
Loop []Vertex
LoopSeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
Stmt Vertex
EndForTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtForeach node
type StmtForeach struct {
Position *position.Position
ForeachTkn *token.Token
OpenParenthesisTkn *token.Token
Expr Vertex
AsTkn *token.Token
Key Vertex
DoubleArrowTkn *token.Token
AmpersandTkn *token.Token
Var Vertex
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
Stmt Vertex
EndForeachTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtFunction node
type StmtFunction struct {
Position *position.Position
AttrGroups []Vertex
FunctionTkn *token.Token
AmpersandTkn *token.Token
2020-12-28 21:01:02 +00:00
Name Vertex
OpenParenthesisTkn *token.Token
Params []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
ReturnType Vertex
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtGlobal node
type StmtGlobal struct {
Position *position.Position
GlobalTkn *token.Token
Vars []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtGoto node
type StmtGoto struct {
Position *position.Position
GotoTkn *token.Token
Label Vertex
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtHaltCompiler node
type StmtHaltCompiler struct {
Position *position.Position
HaltCompilerTkn *token.Token
OpenParenthesisTkn *token.Token
CloseParenthesisTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtIf node
type StmtIf struct {
Position *position.Position
IfTkn *token.Token
OpenParenthesisTkn *token.Token
Cond Vertex
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
Stmt Vertex
ElseIf []Vertex
Else Vertex
EndIfTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtInlineHtml node
type StmtInlineHtml struct {
Position *position.Position
InlineHtmlTkn *token.Token
Value []byte
2020-03-12 22:20:48 +00:00
}
// StmtInterface node
type StmtInterface struct {
Position *position.Position
AttrGroups []Vertex
InterfaceTkn *token.Token
2020-12-28 21:01:02 +00:00
Name Vertex
ExtendsTkn *token.Token
Extends []Vertex
ExtendsSeparatorTkns []*token.Token
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtLabel node
type StmtLabel struct {
2020-12-28 21:01:02 +00:00
Position *position.Position
Name Vertex
ColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtNamespace node
type StmtNamespace struct {
2020-12-11 15:29:22 +00:00
Position *position.Position
NsTkn *token.Token
Name Vertex
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtNop node
type StmtNop struct {
Position *position.Position
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtProperty node
type StmtProperty struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// StmtPropertyList node
type StmtPropertyList struct {
Position *position.Position
AttrGroups []Vertex
Modifiers []Vertex
Type Vertex
2020-12-28 21:01:02 +00:00
Props []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtReturn node
type StmtReturn struct {
Position *position.Position
ReturnTkn *token.Token
Expr Vertex
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtStatic node
type StmtStatic struct {
Position *position.Position
StaticTkn *token.Token
Vars []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtStaticVar node
type StmtStaticVar struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// StmtStmtList node
type StmtStmtList struct {
2020-12-11 15:29:22 +00:00
Position *position.Position
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtSwitch node
type StmtSwitch struct {
Position *position.Position
SwitchTkn *token.Token
OpenParenthesisTkn *token.Token
Cond Vertex
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
OpenCurlyBracketTkn *token.Token
CaseSeparatorTkn *token.Token
2020-12-28 21:01:02 +00:00
Cases []Vertex
CloseCurlyBracketTkn *token.Token
EndSwitchTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtThrow node
type StmtThrow struct {
Position *position.Position
ThrowTkn *token.Token
Expr Vertex
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtTrait node
type StmtTrait struct {
2020-12-11 15:29:22 +00:00
Position *position.Position
AttrGroups []Vertex
2020-12-11 15:29:22 +00:00
TraitTkn *token.Token
2020-12-28 21:01:02 +00:00
Name Vertex
2020-12-11 15:29:22 +00:00
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtTraitUse node
type StmtTraitUse struct {
Position *position.Position
UseTkn *token.Token
Traits []Vertex
SeparatorTkns []*token.Token
OpenCurlyBracketTkn *token.Token
Adaptations []Vertex
CloseCurlyBracketTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtTraitUseAlias node
type StmtTraitUseAlias struct {
Position *position.Position
Trait Vertex
DoubleColonTkn *token.Token
Method Vertex
AsTkn *token.Token
Modifier Vertex
Alias Vertex
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtTraitUsePrecedence node
type StmtTraitUsePrecedence struct {
Position *position.Position
Trait Vertex
DoubleColonTkn *token.Token
Method Vertex
InsteadofTkn *token.Token
Insteadof []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// StmtTry node
type StmtTry struct {
2020-12-11 15:29:22 +00:00
Position *position.Position
TryTkn *token.Token
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
Catches []Vertex
Finally Vertex
2020-03-12 22:20:48 +00:00
}
// StmtUnset node
type StmtUnset struct {
Position *position.Position
UnsetTkn *token.Token
OpenParenthesisTkn *token.Token
Vars []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
2020-12-28 21:01:02 +00:00
// StmtUseList node
type StmtUseList struct {
Position *position.Position
UseTkn *token.Token
Type Vertex
Uses []Vertex
SeparatorTkns []*token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
2020-12-28 21:01:02 +00:00
// StmtGroupUseList node
type StmtGroupUseList struct {
Position *position.Position
UseTkn *token.Token
Type Vertex
LeadingNsSeparatorTkn *token.Token
Prefix Vertex
NsSeparatorTkn *token.Token
OpenCurlyBracketTkn *token.Token
2020-12-28 21:01:02 +00:00
Uses []Vertex
SeparatorTkns []*token.Token
CloseCurlyBracketTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
2020-12-28 21:01:02 +00:00
// StmtUse node
type StmtUse struct {
Position *position.Position
Type Vertex
NsSeparatorTkn *token.Token
Use Vertex
AsTkn *token.Token
Alias Vertex
}
2020-03-12 22:20:48 +00:00
// StmtWhile node
type StmtWhile struct {
Position *position.Position
WhileTkn *token.Token
OpenParenthesisTkn *token.Token
Cond Vertex
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
Stmt Vertex
EndWhileTkn *token.Token
SemiColonTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprArray node
type ExprArray struct {
Position *position.Position
ArrayTkn *token.Token
OpenBracketTkn *token.Token
Items []Vertex
SeparatorTkns []*token.Token
CloseBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprArrayDimFetch node
type ExprArrayDimFetch struct {
Position *position.Position
Var Vertex
OpenBracketTkn *token.Token
Dim Vertex
CloseBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprArrayItem node
type ExprArrayItem struct {
Position *position.Position
EllipsisTkn *token.Token
Key Vertex
DoubleArrowTkn *token.Token
AmpersandTkn *token.Token
Val Vertex
2020-03-12 22:20:48 +00:00
}
// ExprArrowFunction node
type ExprArrowFunction struct {
Position *position.Position
AttrGroups []Vertex
StaticTkn *token.Token
FnTkn *token.Token
AmpersandTkn *token.Token
OpenParenthesisTkn *token.Token
Params []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
ColonTkn *token.Token
ReturnType Vertex
DoubleArrowTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBitwiseNot node
type ExprBitwiseNot struct {
Position *position.Position
TildaTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBooleanNot node
type ExprBooleanNot struct {
Position *position.Position
ExclamationTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
type ExprBrackets struct {
Position *position.Position
OpenParenthesisTkn *token.Token
Expr Vertex
CloseParenthesisTkn *token.Token
}
2020-03-12 22:20:48 +00:00
// ExprClassConstFetch node
type ExprClassConstFetch struct {
Position *position.Position
Class Vertex
DoubleColonTkn *token.Token
2020-12-28 21:01:02 +00:00
Const Vertex
2020-03-12 22:20:48 +00:00
}
// ExprClone node
type ExprClone struct {
Position *position.Position
CloneTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprClosure node
type ExprClosure struct {
Position *position.Position
AttrGroups []Vertex
StaticTkn *token.Token
FunctionTkn *token.Token
AmpersandTkn *token.Token
OpenParenthesisTkn *token.Token
Params []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
UseTkn *token.Token
UseOpenParenthesisTkn *token.Token
2020-12-28 21:01:02 +00:00
Uses []Vertex
UseSeparatorTkns []*token.Token
UseCloseParenthesisTkn *token.Token
ColonTkn *token.Token
ReturnType Vertex
OpenCurlyBracketTkn *token.Token
Stmts []Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprClosureUse node
type ExprClosureUse struct {
Position *position.Position
AmpersandTkn *token.Token
Var Vertex
2020-03-12 22:20:48 +00:00
}
// ExprConstFetch node
type ExprConstFetch struct {
Position *position.Position
Const Vertex
2020-03-12 22:20:48 +00:00
}
// ExprEmpty node
type ExprEmpty struct {
Position *position.Position
EmptyTkn *token.Token
OpenParenthesisTkn *token.Token
Expr Vertex
CloseParenthesisTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprErrorSuppress node
type ExprErrorSuppress struct {
Position *position.Position
AtTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprEval node
type ExprEval struct {
Position *position.Position
EvalTkn *token.Token
OpenParenthesisTkn *token.Token
Expr Vertex
CloseParenthesisTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprExit node
type ExprExit struct {
Position *position.Position
2020-12-26 20:41:25 +00:00
ExitTkn *token.Token
OpenParenthesisTkn *token.Token
Expr Vertex
CloseParenthesisTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprFunctionCall node
type ExprFunctionCall struct {
Position *position.Position
Function Vertex
OpenParenthesisTkn *token.Token
2020-12-28 21:01:02 +00:00
Args []Vertex
SeparatorTkns []*token.Token
EllipsisTkn *token.Token
CloseParenthesisTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprInclude node
type ExprInclude struct {
Position *position.Position
IncludeTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprIncludeOnce node
type ExprIncludeOnce struct {
Position *position.Position
IncludeOnceTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprInstanceOf node
type ExprInstanceOf struct {
Position *position.Position
Expr Vertex
InstanceOfTkn *token.Token
Class Vertex
2020-03-12 22:20:48 +00:00
}
// ExprIsset node
type ExprIsset struct {
Position *position.Position
IssetTkn *token.Token
OpenParenthesisTkn *token.Token
Vars []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprList node
type ExprList struct {
Position *position.Position
ListTkn *token.Token
OpenBracketTkn *token.Token
Items []Vertex
SeparatorTkns []*token.Token
CloseBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprMethodCall node
type ExprMethodCall struct {
Position *position.Position
Var Vertex
ObjectOperatorTkn *token.Token
OpenCurlyBracketTkn *token.Token
Method Vertex
CloseCurlyBracketTkn *token.Token
OpenParenthesisTkn *token.Token
2020-12-28 21:01:02 +00:00
Args []Vertex
SeparatorTkns []*token.Token
EllipsisTkn *token.Token
CloseParenthesisTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprNullsafeMethodCall node is $a?->methodName()
type ExprNullsafeMethodCall struct {
Position *position.Position
Var Vertex
ObjectOperatorTkn *token.Token
OpenCurlyBracketTkn *token.Token
Method Vertex
CloseCurlyBracketTkn *token.Token
OpenParenthesisTkn *token.Token
Args []Vertex
SeparatorTkns []*token.Token
EllipsisTkn *token.Token
CloseParenthesisTkn *token.Token
}
2020-03-12 22:20:48 +00:00
// ExprNew node
type ExprNew struct {
Position *position.Position
NewTkn *token.Token
Class Vertex
OpenParenthesisTkn *token.Token
2020-12-28 21:01:02 +00:00
Args []Vertex
SeparatorTkns []*token.Token
CloseParenthesisTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprPostDec node
type ExprPostDec struct {
Position *position.Position
Var Vertex
DecTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprPostInc node
type ExprPostInc struct {
Position *position.Position
Var Vertex
IncTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprPreDec node
type ExprPreDec struct {
Position *position.Position
DecTkn *token.Token
Var Vertex
2020-03-12 22:20:48 +00:00
}
// ExprPreInc node
type ExprPreInc struct {
Position *position.Position
IncTkn *token.Token
Var Vertex
2020-03-12 22:20:48 +00:00
}
// ExprPrint node
type ExprPrint struct {
Position *position.Position
PrintTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprPropertyFetch node
type ExprPropertyFetch struct {
Position *position.Position
Var Vertex
ObjectOperatorTkn *token.Token
OpenCurlyBracketTkn *token.Token
2020-12-28 21:01:02 +00:00
Prop Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprNullsafePropertyFetch node
type ExprNullsafePropertyFetch struct {
Position *position.Position
Var Vertex
ObjectOperatorTkn *token.Token
OpenCurlyBracketTkn *token.Token
Prop Vertex
CloseCurlyBracketTkn *token.Token
}
2020-03-12 22:20:48 +00:00
// ExprRequire node
type ExprRequire struct {
Position *position.Position
RequireTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprRequireOnce node
type ExprRequireOnce struct {
Position *position.Position
RequireOnceTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprShellExec node
type ExprShellExec struct {
Position *position.Position
OpenBacktickTkn *token.Token
Parts []Vertex
CloseBacktickTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprStaticCall node
type ExprStaticCall struct {
Position *position.Position
Class Vertex
DoubleColonTkn *token.Token
OpenCurlyBracketTkn *token.Token
Call Vertex
CloseCurlyBracketTkn *token.Token
OpenParenthesisTkn *token.Token
2020-12-28 21:01:02 +00:00
Args []Vertex
SeparatorTkns []*token.Token
EllipsisTkn *token.Token
CloseParenthesisTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprStaticPropertyFetch node
type ExprStaticPropertyFetch struct {
Position *position.Position
Class Vertex
DoubleColonTkn *token.Token
2020-12-28 21:01:02 +00:00
Prop Vertex
2020-03-12 22:20:48 +00:00
}
// ExprTernary node
type ExprTernary struct {
Position *position.Position
2020-12-28 21:01:02 +00:00
Cond Vertex
QuestionTkn *token.Token
IfTrue Vertex
ColonTkn *token.Token
IfFalse Vertex
2020-03-12 22:20:48 +00:00
}
// ExprUnaryMinus node
type ExprUnaryMinus struct {
Position *position.Position
MinusTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprUnaryPlus node
type ExprUnaryPlus struct {
Position *position.Position
PlusTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprVariable node
type ExprVariable struct {
Position *position.Position
DollarTkn *token.Token
OpenCurlyBracketTkn *token.Token
2020-12-28 21:01:02 +00:00
Name Vertex
CloseCurlyBracketTkn *token.Token
2020-03-12 22:20:48 +00:00
}
// ExprYield node
type ExprYield struct {
Position *position.Position
YieldTkn *token.Token
Key Vertex
DoubleArrowTkn *token.Token
2020-12-28 21:01:02 +00:00
Val Vertex
2020-03-12 22:20:48 +00:00
}
// ExprYieldFrom node
type ExprYieldFrom struct {
Position *position.Position
YieldFromTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprCastArray node
type ExprCastArray struct {
Position *position.Position
CastTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprCastBool node
type ExprCastBool struct {
Position *position.Position
CastTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprCastDouble node
type ExprCastDouble struct {
Position *position.Position
CastTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprCastInt node
type ExprCastInt struct {
Position *position.Position
CastTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprCastObject node
type ExprCastObject struct {
Position *position.Position
CastTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprCastString node
type ExprCastString struct {
Position *position.Position
CastTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprCastUnset node
type ExprCastUnset struct {
Position *position.Position
CastTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssign node
type ExprAssign struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignReference node
type ExprAssignReference struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
AmpersandTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignBitwiseAnd node
type ExprAssignBitwiseAnd struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignBitwiseOr node
type ExprAssignBitwiseOr struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignBitwiseXor node
type ExprAssignBitwiseXor struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignCoalesce node
type ExprAssignCoalesce struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignConcat node
type ExprAssignConcat struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignDiv node
type ExprAssignDiv struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignMinus node
type ExprAssignMinus struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignMod node
type ExprAssignMod struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignMul node
type ExprAssignMul struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignPlus node
type ExprAssignPlus struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignPow node
type ExprAssignPow struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignShiftLeft node
type ExprAssignShiftLeft struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprAssignShiftRight node
type ExprAssignShiftRight struct {
Position *position.Position
Var Vertex
EqualTkn *token.Token
Expr Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryBitwiseAnd node
type ExprBinaryBitwiseAnd struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryBitwiseOr node
type ExprBinaryBitwiseOr struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryBitwiseXor node
type ExprBinaryBitwiseXor struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryBooleanAnd node
type ExprBinaryBooleanAnd struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryBooleanOr node
type ExprBinaryBooleanOr struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryCoalesce node
type ExprBinaryCoalesce struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryConcat node
type ExprBinaryConcat struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryDiv node
type ExprBinaryDiv struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryEqual node
type ExprBinaryEqual struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryGreater node
type ExprBinaryGreater struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryGreaterOrEqual node
type ExprBinaryGreaterOrEqual struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryIdentical node
type ExprBinaryIdentical struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryLogicalAnd node
type ExprBinaryLogicalAnd struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryLogicalOr node
type ExprBinaryLogicalOr struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryLogicalXor node
type ExprBinaryLogicalXor struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryMinus node
type ExprBinaryMinus struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryMod node
type ExprBinaryMod struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryMul node
type ExprBinaryMul struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryNotEqual node
type ExprBinaryNotEqual struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryNotIdentical node
type ExprBinaryNotIdentical struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryPlus node
type ExprBinaryPlus struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryPow node
type ExprBinaryPow struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryShiftLeft node
type ExprBinaryShiftLeft struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinaryShiftRight node
type ExprBinaryShiftRight struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinarySmaller node
type ExprBinarySmaller struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinarySmallerOrEqual node
type ExprBinarySmallerOrEqual struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprBinarySpaceship node
type ExprBinarySpaceship struct {
Position *position.Position
Left Vertex
OpTkn *token.Token
Right Vertex
2020-03-12 22:20:48 +00:00
}
// ExprMatch node is match(expr) { list<MatchArm> }
type ExprMatch struct {
Position *position.Position
MatchTkn *token.Token
OpenParenthesisTkn *token.Token
Expr Vertex
CloseParenthesisTkn *token.Token
OpenCurlyBracketTkn *token.Token
Arms []Vertex
SeparatorTkns []*token.Token
CloseCurlyBracketTkn *token.Token
}
// ExprThrow node is 'throw Expr'
type ExprThrow struct {
Position *position.Position
ThrowTkn *token.Token
Expr Vertex
SemiColonTkn *token.Token
}
// MatchArm node is [expr, expr1, ...]|default => return_expr
type MatchArm struct {
Position *position.Position
DefaultTkn *token.Token
DefaultCommaTkn *token.Token
Exprs []Vertex
SeparatorTkns []*token.Token
DoubleArrowTkn *token.Token
ReturnExpr Vertex
}
2020-12-28 21:01:02 +00:00
type Name struct {
Position *position.Position
Parts []Vertex
SeparatorTkns []*token.Token
2020-05-12 21:16:36 +00:00
}
type NameFullyQualified struct {
Position *position.Position
NsSeparatorTkn *token.Token
Parts []Vertex
SeparatorTkns []*token.Token
2020-05-12 21:16:36 +00:00
}
type NameRelative struct {
Position *position.Position
NsTkn *token.Token
NsSeparatorTkn *token.Token
Parts []Vertex
SeparatorTkns []*token.Token
2020-05-12 21:16:36 +00:00
}
2020-12-28 21:01:02 +00:00
type NamePart struct {
Position *position.Position
StringTkn *token.Token
Value []byte
2020-05-12 21:16:36 +00:00
}