package parser

import "github.com/azin-lang/Azin/pkg/parser"

Index

Constants

const (
	PrecLowest     int
	PrecBitwiseAnd // &
	PrecEquality   // ==, !=
	PrecComparison // <, >, <=, >=
	PrecShift      // <<, >>
	PrecTerm       // +, -
	PrecFactor     // *, /
	PrecCall       // (
	PrecMember     // .
)

Functions

func Parse

func Parse(source string, tokens []token2.Token, diag ErrorReporter) (*ast.Program, error)

Types

type ErrorReporter

type ErrorReporter interface {
	ReportError(pos token2.Position, length int, format string, args ...any)
	Err() error
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}
func New
func New(source string, tokens []token2.Token, diag ErrorReporter) *Parser
func (*Parser) Err
func (p *Parser) Err() error
func (*Parser) ParseProgram
func (p *Parser) ParseProgram() *ast.Program