parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOWEST int
	LOGIC
	EQUALS
	LESSGREATER
	SUM
	PRODUCT
	PREFIX
	INDEX
	CALL
)

Constants for denoting precedence

Variables

This section is empty.

Functions

func BuildAST

func BuildAST(file []byte) *ast.Program

BuildAST tokenizes and parses given file to build AST

Types

type Parser

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

Parser represents lexical analyzer struct

func New

func New(l *lexer.Lexer) *Parser

New initializes a parser and returns it

func (*Parser) CheckErrors

func (p *Parser) CheckErrors()

CheckErrors is checking for parser's errors existence

func (*Parser) Errors

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

Errors return parser errors

func (*Parser) ParseProgram

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

ParseProgram update program statements and return program

Jump to

Keyboard shortcuts

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