parser

package
v0.0.0-...-402e600 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2017 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDeclaration

func ParseDeclaration(code string) (ast.Declare, error)

func ParseExpression

func ParseExpression(code string) (ast.Expression, error)

func ParseStatement

func ParseStatement(code string) (ast.Statement, error)

Types

type Error

type Error struct {
	Message string
}

Error represents an error in the parser package

func (*Error) Error

func (e *Error) Error() string

type InternalError

type InternalError struct {
	Message string
	Stack   string
}

InternalError represents an error in the parser package that is unexpected

func (*InternalError) Error

func (e *InternalError) Error() string

type Parser

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

Parser creates an abstract syntax tree from a sequence of tokens

func NewParser

func NewParser(tokens []lexer.Token, scope bool) *Parser

NewParser creates a new parser, if scope is false all block scopes will be nil

func (*Parser) Parse

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

Jump to

Keyboard shortcuts

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