parser

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxParserDepth limits recursion depth to prevent stack overflow
	MaxParserDepth = 100
	// MaxExpressionCount limits number of expressions in lists
	MaxExpressionCount = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser consumes SQL tokens and produces AST nodes for a core ANSI subset.

func New

func New(l *lexer.Lexer) *Parser

New returns a parser over the provided lexer.

func (*Parser) Errors

func (p *Parser) Errors() []error

Errors exposes parsing errors encountered so far.

func (*Parser) ParseStatement

func (p *Parser) ParseStatement() ast.Statement

ParseStatement parses a top-level SQL statement.

type SyntaxError

type SyntaxError struct {
	Pos token.Position
	Msg string
}

SyntaxError describes a parsing failure with source position context.

func (*SyntaxError) Error

func (e *SyntaxError) Error() string

Jump to

Keyboard shortcuts

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