query

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const T_AND = 57366
View Source
const T_ASC = 57355
View Source
const T_COMMENT = 57361
View Source
const T_CONSTANT_STRING = 57358
View Source
const T_COUNT = 57350
View Source
const T_DESC = 57354
View Source
const T_DNUMBER = 57357
View Source
const T_DOC_COMMENT = 57362
View Source
const T_EQUAL = 57368
View Source
const T_FROM = 57347
View Source
const T_GREATER = 57371
View Source
const T_GREATER_OR_EQUAL = 57373
View Source
const T_LIMIT = 57351
View Source
const T_LNUMBER = 57356
View Source
const T_NOT = 57367
View Source
const T_NOT_EQUAL = 57369
View Source
const T_OBJECT_OPERATOR = 57374
View Source
const T_OFFSET = 57352
View Source
const T_OR = 57364
View Source
const T_ORDER_BY = 57353
View Source
const T_SELECT = 57346
View Source
const T_SMALLER = 57370
View Source
const T_SMALLER_OR_EQUAL = 57372
View Source
const T_STRING = 57359
View Source
const T_VARIABLE = 57360
View Source
const T_WHERE = 57348
View Source
const T_WHITESPACE = 57363
View Source
const T_WITH = 57349
View Source
const T_XOR = 57365

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentList

type ArgumentList struct {
	Pos                 *position.Pos
	OpenParenthesisTkn  *token.Token
	Arguments           []ast.Node
	SeparatorTkns       []*token.Token
	EllipsisTkn         *token.Token
	CloseParenthesisTkn *token.Token
}

ArgumentList node

func (*ArgumentList) GetPos

func (n *ArgumentList) GetPos() *position.Pos

func (*ArgumentList) Walk

func (n *ArgumentList) Walk(v ast.Visitor)

type Builder

type Builder struct {
	Pos    *position.Builder
	Parser *Parser
}

Builder is responsible for creating nodes inside grammar rules. Creating nodes directly in grammar rules is inconvenient, since there is no autocompletion, and you cannot put breakpoints inside.

func NewBuilder

func NewBuilder(pos *position.Builder, parser *Parser) *Builder

NewBuilder creates a new Builder.

func (*Builder) AppendToSeparatedList

func (b *Builder) AppendToSeparatedList(list ast.Node, tkn *token.Token, node ast.Node) *ast.CommaSeparatedList

AppendToSeparatedList inserts a new node and/or token into the list.

func (*Builder) NewBasicLit

func (b *Builder) NewBasicLit(
	LiteralTkn *token.Token,
) *ast.BasicLit

func (*Builder) NewBinaryExpr

func (b *Builder) NewBinaryExpr(
	Left ast.Node,
	OpTkn *token.Token,
	Right ast.Node,
) *ast.BinaryExpr

func (*Builder) NewComparisonExpr

func (b *Builder) NewComparisonExpr(
	Variable ast.Node,
	OpTkn *token.Token,
	Expr ast.Node,
) *ast.ComparisonExpr

func (*Builder) NewEmptySeparatedList

func (b *Builder) NewEmptySeparatedList() *ast.CommaSeparatedList

NewEmptySeparatedList creates a new empty list. Used for places where a delimited list is used.

func (*Builder) NewFromExpr

func (b *Builder) NewFromExpr(
	FromTkn *token.Token,
	From ast.Node,
) *ast.FromExpr

func (*Builder) NewIdentifier

func (b *Builder) NewIdentifier(
	IdentifierTkn *token.Token,
) *ast.Identifier

func (*Builder) NewLimitExpr

func (b *Builder) NewLimitExpr(
	LimitTkn *token.Token,
	Value ast.Node,
) *ast.LimitExpr

func (*Builder) NewMethodCallExpr

func (b *Builder) NewMethodCallExpr(
	Variable ast.Node,
	OpTkn *token.Token,
	MethodName *token.Token,
	OpenBracketTkn *token.Token,
	Args ast.Node,
	CloseBracketTkn *token.Token,
) *ast.MethodCallExpr

func (*Builder) NewNonEmptySeparatedList

func (b *Builder) NewNonEmptySeparatedList(nodes []ast.Node, tkns []*token.Token) *ast.CommaSeparatedList

func (*Builder) NewNotExpr

func (b *Builder) NewNotExpr(
	NotTkn *token.Token,
	Expr ast.Node,
) *ast.NotExpr

func (*Builder) NewOrderByExpr

func (b *Builder) NewOrderByExpr(
	OrderByTkn *token.Token,
	Value ast.Node,
	DescOrAscTkn *token.Token,
) *ast.OrderByExpr

func (*Builder) NewRoot

func (b *Builder) NewRoot(
	Stmts []ast.Node,
) *ast.Root

func (*Builder) NewSelectExpr

func (b *Builder) NewSelectExpr(
	SelectTkn *token.Token,
	Select ast.Node,
	FromExpr ast.Node,
	WhereExpr ast.Node,
	WithExpr ast.Node,
	LimitExpr ast.Node,
	OrderByExpr ast.Node,
) *ast.SelectExpr

func (*Builder) NewSelectSubjectExpr

func (b *Builder) NewSelectSubjectExpr(
	List ast.Node,
	Count *token.Token,
	Star *token.Token,
) *ast.SelectSubjectExpr

func (*Builder) NewSeparatedList

func (b *Builder) NewSeparatedList(node ast.Node) *ast.CommaSeparatedList

NewSeparatedList creates a new single-element list. Used for places where a delimited list is used.

func (*Builder) NewSeparatedListWithTwoElements

func (b *Builder) NewSeparatedListWithTwoElements(node1 ast.Node, tkn *token.Token, node2 ast.Node) *ast.CommaSeparatedList

NewSeparatedListWithTwoElements creates a new two-element list. Used for places where a delimited list is used.

func (*Builder) NewVariable

func (b *Builder) NewVariable(
	VariableTkn *token.Token,
) *ast.Variable

func (*Builder) NewWhereExpr

func (b *Builder) NewWhereExpr(
	WhereTkn *token.Token,
	Expr ast.Node,
) *ast.WhereExpr

func (*Builder) NewWithExpr

func (b *Builder) NewWithExpr(
	WithTkn *token.Token,
	WithList ast.Node,
) *ast.WithExpr

func (*Builder) SeparatedListItems

func (b *Builder) SeparatedListItems(list ast.Node) (items []ast.Node, sepTkns []*token.Token)

type EnumCaseExpr

type EnumCaseExpr struct {
	Pos       *position.Pos
	AssignTkn *token.Token
	Expr      ast.Node
}

func (*EnumCaseExpr) GetPos

func (n *EnumCaseExpr) GetPos() *position.Pos

func (*EnumCaseExpr) Walk

func (n *EnumCaseExpr) Walk(v ast.Visitor)

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

func NewLexer

func NewLexer(data []byte, config conf.Config) *Lexer

func (*Lexer) Lex

func (lex *Lexer) Lex() *token.Token

type NewLines

type NewLines struct {
	// contains filtered or unexported fields
}

func (*NewLines) Append

func (nl *NewLines) Append(p int)

func (*NewLines) GetLine

func (nl *NewLines) GetLine(p int) int

type Parser

type Parser struct {
	Lexer *Lexer
	// contains filtered or unexported fields
}

Parser structure

func NewParser

func NewParser(lexer *Lexer) *Parser

NewParser creates and returns new Parser

func (*Parser) Error

func (p *Parser) Error(msg string)

func (*Parser) GetRootNode

func (p *Parser) GetRootNode() ast.Node

GetRootNode returns root node

func (*Parser) Lex

func (p *Parser) Lex(lval *yySymType) int

func (*Parser) Parse

func (p *Parser) Parse() int

Parse the php7 Parser entrypoint

type ParserBrackets

type ParserBrackets struct {
	Pos             *position.Pos
	OpenBracketTkn  *token.Token
	Child           ast.Node
	CloseBracketTkn *token.Token
}

func (*ParserBrackets) GetPos

func (n *ParserBrackets) GetPos() *position.Pos

func (*ParserBrackets) Walk

func (n *ParserBrackets) Walk(v ast.Visitor)

type ParserSeparatedList

type ParserSeparatedList struct {
	Pos           *position.Pos
	Items         []ast.Node
	SeparatorTkns []*token.Token
}

func (*ParserSeparatedList) GetPos

func (n *ParserSeparatedList) GetPos() *position.Pos

func (*ParserSeparatedList) Walk

func (n *ParserSeparatedList) Walk(v ast.Visitor)

type ReturnType

type ReturnType struct {
	Pos      *position.Pos
	ColonTkn *token.Token
	Type     ast.Node
}

func (*ReturnType) GetPos

func (n *ReturnType) GetPos() *position.Pos

func (*ReturnType) Walk

func (n *ReturnType) Walk(v ast.Visitor)

type TraitAdaptationList

type TraitAdaptationList struct {
	Pos                  *position.Pos
	OpenCurlyBracketTkn  *token.Token
	Adaptations          []ast.Node
	CloseCurlyBracketTkn *token.Token
}

TraitAdaptationList node

func (*TraitAdaptationList) GetPos

func (n *TraitAdaptationList) GetPos() *position.Pos

func (*TraitAdaptationList) Walk

func (n *TraitAdaptationList) Walk(v ast.Visitor)

type TraitMethodRef

type TraitMethodRef struct {
	Pos            *position.Pos
	Trait          ast.Node
	DoubleColonTkn *token.Token
	Method         ast.Node
}

TraitMethodRef node

func (*TraitMethodRef) GetPos

func (n *TraitMethodRef) GetPos() *position.Pos

func (*TraitMethodRef) Walk

func (n *TraitMethodRef) Walk(v ast.Visitor)

Jump to

Keyboard shortcuts

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