parser

package
v0.0.0-...-44ce166 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatErrorWithParserLocation

func FormatErrorWithParserLocation(err error) error

func PrintParserError

func PrintParserError(src string, err error)

Types

type Parser

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

func NewParser

func NewParser(lexer *lexer.Lexer) *Parser

Creates a new parser using the given Lexer as a source of input tokens

func (*Parser) ParseProgramFully

func (parser *Parser) ParseProgramFully() (*ast.Program, error)

Parses a full program, terminated by EOF

func (*Parser) ParseProgramOrReactionDefFully

func (parser *Parser) ParseProgramOrReactionDefFully(store *eval.ReactionStore) (*ast.Program, *ast.ReactionPointer, error)

Parses a full program or reaction definition, terminated by EOF

type ParserError

type ParserError struct {
	LexerCurrentLine   int
	LexerCurrentColumn int
	// contains filtered or unexported fields
}

Custom error wrapper which additionally contains information about the state of the lexer when the error occurred. (where in the src code caused the parsing error!)

func (*ParserError) Cause

func (err *ParserError) Cause() error

func (*ParserError) Error

func (err *ParserError) Error() string

func (*ParserError) Unwrap

func (err *ParserError) Unwrap() error

Jump to

Keyboard shortcuts

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