parser

package
v0.0.0-...-68482a3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOWEST      int
	EQUALS      // =
	LESSGREATER // > or <
	SUM         // +
	PRODUCT     // *
	PREFIX      // - or NOT
	LOGICAL     // AND OR XOR
	CALL        // MyFunction(X)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	ErrorTokenIndex int // the index of the token where an error occured
	// contains filtered or unexported fields
}

func New

func New(l *lexer.Lexer, g *game.Game) *Parser

func (*Parser) Errors

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

func (*Parser) GetError

func (p *Parser) GetError() (string, bool)

GetError returns the current error message and a boolean to indicate if the parser failed

func (*Parser) JumpToToken

func (p *Parser) JumpToToken(i int)

func (*Parser) ParseLine

func (p *Parser) ParseLine() *ast.Line

func (*Parser) ParseProgram

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

func (*Parser) PrettyPrint

func (p *Parser) PrettyPrint() string

Jump to

Keyboard shortcuts

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