2021-07-30 17:53:27 +00:00
|
|
|
package php8
|
|
|
|
|
|
|
|
import (
|
2023-12-09 21:36:19 +00:00
|
|
|
"git.maride.cc/maride/php-parser/pkg/ast"
|
|
|
|
"git.maride.cc/maride/php-parser/pkg/position"
|
|
|
|
"git.maride.cc/maride/php-parser/pkg/token"
|
2021-07-30 17:53:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type ParserBrackets struct {
|
|
|
|
Position *position.Position
|
|
|
|
OpenBracketTkn *token.Token
|
|
|
|
Child ast.Vertex
|
|
|
|
CloseBracketTkn *token.Token
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *ParserBrackets) Accept(v ast.Visitor) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *ParserBrackets) GetPosition() *position.Position {
|
|
|
|
return n.Position
|
|
|
|
}
|
|
|
|
|
2023-03-26 19:31:37 +00:00
|
|
|
func (n *ParserBrackets) GetType() ast.Type {
|
|
|
|
return ast.TypeNone
|
|
|
|
}
|
|
|
|
|
2021-07-30 17:53:27 +00:00
|
|
|
type ParserSeparatedList struct {
|
|
|
|
Position *position.Position
|
|
|
|
Items []ast.Vertex
|
|
|
|
SeparatorTkns []*token.Token
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *ParserSeparatedList) Accept(v ast.Visitor) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *ParserSeparatedList) GetPosition() *position.Position {
|
|
|
|
return n.Position
|
|
|
|
}
|
|
|
|
|
2023-03-26 19:31:37 +00:00
|
|
|
func (n *ParserSeparatedList) GetType() ast.Type {
|
|
|
|
return ast.TypeNone
|
|
|
|
}
|
|
|
|
|
2021-07-30 17:53:27 +00:00
|
|
|
// TraitAdaptationList node
|
|
|
|
type TraitAdaptationList struct {
|
|
|
|
Position *position.Position
|
|
|
|
OpenCurlyBracketTkn *token.Token
|
|
|
|
Adaptations []ast.Vertex
|
|
|
|
CloseCurlyBracketTkn *token.Token
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *TraitAdaptationList) Accept(v ast.Visitor) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *TraitAdaptationList) GetPosition() *position.Position {
|
|
|
|
return n.Position
|
|
|
|
}
|
|
|
|
|
2023-03-26 19:31:37 +00:00
|
|
|
func (n *TraitAdaptationList) GetType() ast.Type {
|
|
|
|
return ast.TypeNone
|
|
|
|
}
|
|
|
|
|
2021-07-30 17:53:27 +00:00
|
|
|
// ArgumentList node
|
|
|
|
type ArgumentList struct {
|
|
|
|
Position *position.Position
|
|
|
|
OpenParenthesisTkn *token.Token
|
|
|
|
Arguments []ast.Vertex
|
|
|
|
SeparatorTkns []*token.Token
|
2021-07-31 20:50:59 +00:00
|
|
|
EllipsisTkn *token.Token
|
2021-07-30 17:53:27 +00:00
|
|
|
CloseParenthesisTkn *token.Token
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *ArgumentList) Accept(v ast.Visitor) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *ArgumentList) GetPosition() *position.Position {
|
|
|
|
return n.Position
|
|
|
|
}
|
|
|
|
|
2023-03-26 19:31:37 +00:00
|
|
|
func (n *ArgumentList) GetType() ast.Type {
|
|
|
|
return ast.TypeNone
|
|
|
|
}
|
|
|
|
|
2021-07-31 16:44:09 +00:00
|
|
|
type EnumCaseExpr struct {
|
|
|
|
Position *position.Position
|
|
|
|
AssignTkn *token.Token
|
|
|
|
Expr ast.Vertex
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *EnumCaseExpr) Accept(v ast.Visitor) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *EnumCaseExpr) GetPosition() *position.Position {
|
|
|
|
return n.Position
|
|
|
|
}
|
|
|
|
|
2023-03-26 19:31:37 +00:00
|
|
|
func (n *EnumCaseExpr) GetType() ast.Type {
|
|
|
|
return ast.TypeNone
|
|
|
|
}
|
|
|
|
|
2021-07-30 17:53:27 +00:00
|
|
|
type ReturnType struct {
|
|
|
|
Position *position.Position
|
|
|
|
ColonTkn *token.Token
|
|
|
|
Type ast.Vertex
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *ReturnType) Accept(v ast.Visitor) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *ReturnType) GetPosition() *position.Position {
|
|
|
|
return n.Position
|
|
|
|
}
|
|
|
|
|
2023-03-26 19:31:37 +00:00
|
|
|
func (n *ReturnType) GetType() ast.Type {
|
|
|
|
return ast.TypeNone
|
|
|
|
}
|
|
|
|
|
2021-07-30 17:53:27 +00:00
|
|
|
// TraitMethodRef node
|
|
|
|
type TraitMethodRef struct {
|
|
|
|
Position *position.Position
|
|
|
|
Trait ast.Vertex
|
|
|
|
DoubleColonTkn *token.Token
|
|
|
|
Method ast.Vertex
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *TraitMethodRef) Accept(v ast.Visitor) {
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
func (n *TraitMethodRef) GetPosition() *position.Position {
|
|
|
|
return n.Position
|
|
|
|
}
|
2023-03-26 19:31:37 +00:00
|
|
|
|
|
|
|
func (n *TraitMethodRef) GetType() ast.Type {
|
|
|
|
return ast.TypeNone
|
|
|
|
}
|