parser

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	LOWEST int
	ASSIGN_PREC
	NULLISH_COALESCE
	LOGICAL_OR
	LOGICAL_AND
	BIT_OR
	BIT_XOR
	BIT_AND
	EQUALS
	LESSGREATER
	BIT_SHIFT
	SUM
	RANGE_PREC
	PRODUCT
	POWER
	PREFIX
	CALL
	INDEX
	POSTFIX
)

Operator precedence levels.

Variables

This section is empty.

Functions

func LineContext

func LineContext(input string, line, col int) string

Types

type Parser

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

Parser produces an AST from a token stream.

func NewParser

func NewParser(l *lexer.Lexer) *Parser

NewParser creates a new Parser that reads tokens from l.

func (*Parser) Errors

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

Errors returns the list of parsing errors.

func (*Parser) InitBlocks

func (p *Parser) InitBlocks() []*ast.InitStatement

InitBlocks returns the init blocks collected during parsing.

func (*Parser) ParseProgram

func (p *Parser) ParseProgram() *ast.Program

ParseProgram parses the full input and returns the root AST node.

type ParserState

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

ParserState captures the parser's position for back-tracking.

Jump to

Keyboard shortcuts

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