parser

package
v0.0.0-...-1e04c87 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package parser attempts to organise tokens into an AST

Index

Constants

View Source
const (

	// LOWEST represents lowest precedence
	LOWEST int
	// EQUALS : ==
	EQUALS
	// LESSGREATER : > or <
	LESSGREATER
	// SUM : +
	SUM
	// PRODUCT : *
	PRODUCT
	// PREFIX : -X or !X
	PREFIX
	// CALL :  myFunction(X)
	CALL
	// INDEX : array[index]
	INDEX
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser attempts to make sense of tokens

func New

func New(l *lexer.Lexer) *Parser

New creates, initialises and returns a new Parser

func (*Parser) Errors

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

Errors returns a list of parse errors

func (*Parser) ParseProgram

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

ParseProgram parses an entire proram into an AST

Jump to

Keyboard shortcuts

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