parser

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package parser defines the actual parser for DLiteScript.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser defines the parser itself.

func NewParser

func NewParser(tokens []*token.Token) *Parser

NewParser creates a new instance of the Parser struct.

func (*Parser) AdvancePosition added in v0.1.2

func (p *Parser) AdvancePosition(token *token.Token)

AdvancePosition advances the position.

func (*Parser) GetCurrentPosition added in v0.1.2

func (p *Parser) GetCurrentPosition() ast.Position

GetCurrentPosition gets the current position.

func (*Parser) GetNextToken

func (p *Parser) GetNextToken() (*token.Token, error)

GetNextToken gets the next token and advances the current token index.

func (*Parser) Parse

func (p *Parser) Parse() (ast.ExprNode, error)

Parse parses the expression string supplied in the struct.

func (*Parser) PeekNextToken

func (p *Parser) PeekNextToken() (*token.Token, error)

PeekNextToken gets the next token without advancing the current token index.

Jump to

Keyboard shortcuts

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