Documentation ¶
Overview ¶
Package parser contains all the logic to parse
Index ¶
- func Parse(query string) (commandResult command.Command, finalErr error)
- type Assert
- type AssertionError
- type Parser
- func (t *Parser) AST() *node32
- func (t *Parser) Add(rule pegRule, begin, end, index uint32)
- func (p *Parser) Execute()
- func (p *Parser) Init()
- func (p *Parser) Parse(rule ...int) error
- func (t *Parser) PrettyPrintSyntaxTree(buffer string)
- func (t *Parser) Print()
- func (p *Parser) PrintSyntaxTree()
- func (p *Parser) Reset()
- func (t *Parser) Tokens() []token32
- func (t *Parser) Trim(length uint32)
- type ParserError
- type SyntaxError
- type SyntaxErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Assert ¶
type Assert struct {
// contains filtered or unexported fields
}
An Assert is a kind of error that occurs due to a bug in the parser itself.
type AssertionError ¶
type AssertionError struct {
// contains filtered or unexported fields
}
AssertionError is raised when an internal invariant is violated, indicating a programming bug.
func (AssertionError) Error ¶
func (err AssertionError) Error() string
type Parser ¶
func (*Parser) PrettyPrintSyntaxTree ¶
func (t *Parser) PrettyPrintSyntaxTree(buffer string)
func (*Parser) PrintSyntaxTree ¶
func (p *Parser) PrintSyntaxTree()
type ParserError ¶
type ParserError error
A ParserError wraps an error raised during parser execution.
type SyntaxError ¶
type SyntaxError struct {
// contains filtered or unexported fields
}
SyntaxError is raised when the user query is invalid. This can happen for two reasons: * The query does not generate a valid AST. * Invalid input is provided
func (SyntaxError) Error ¶
func (err SyntaxError) Error() string
func (SyntaxError) Token ¶
func (err SyntaxError) Token() string
Token returns the token of the AST related to the parsing error.
type SyntaxErrors ¶
type SyntaxErrors []SyntaxError
SyntaxErrors is a slice of SyntaxErrors implementing Error() method.
func (SyntaxErrors) Error ¶
func (errors SyntaxErrors) Error() string
Click to show internal directories.
Click to hide internal directories.