parser

package
v0.1.1-0...-8b6b0d7 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2018 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message    string
	Start, End token.Position
}

Error represents a parsing error

type Parser

type Parser struct {
	Errors []Error
	// contains filtered or unexported fields
}

Parser parses a string into an abstract syntax tree

func New

func New(text, file string) *Parser

New returns a new parser for the given string

func (*Parser) Err

func (p *Parser) Err(msg string, start, end token.Position)

Err creates an Error instance with the given arguments

func (*Parser) Parse

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

Parse parses an entire program

func (*Parser) PrintErrors

func (p *Parser) PrintErrors()

PrintErrors prints all parser errors in a nice format

Jump to

Keyboard shortcuts

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