parser

package
v0.0.0-...-8bbaf59 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string
const (
	EXPECTED_EXPRESSION     Error = "expect expression"
	INVALID_INTEGER_LITERAL Error = "invalid integer literal"
	UNEXPECTED_TOKEN        Error = "unexpected token"
)

type InfixParseFunc

type InfixParseFunc func(expression ast.Expression) ast.Expression

type Parser

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

func New

func New(input string) *Parser

func (*Parser) Errors

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

func (*Parser) ParseProgram

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

type Precedence

type Precedence int
const (
	NONE       Precedence
	EQUALITY   // ==
	COMPARISON // > or <
	TERM       // +
	FACTOR     // *
	UNARY      // -x or !x
	CALL       // myFunction(x)
	INDEX      // array[index]
)

type PrefixParseFunc

type PrefixParseFunc func() ast.Expression

type Rule

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

Jump to

Keyboard shortcuts

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