parser

package
v0.0.0-...-0f5256c Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseIO

func ParseIO(src io.Reader, fileName string) (ast.Node, error)

func ParseString

func ParseString(src string, fileName string) (ast.Node, error)

Types

type Lexer

type Lexer interface {
	Lex() (Token, error)
}

Lexer is YAS lexical analizer.

func NewLexer

func NewLexer(src io.Reader, fileName string) Lexer

NewLexer creates a new instance of YAS lexer and return it. `fileName` is used for some error message.

type ParseError

type ParseError interface {
	error
	FileName() string
	Line() int
	Column() int
}

ParseError represents parsing failure with some location of cause

type Token

type Token interface {
	Kind() int
	Value() interface{}
	Line() int
	Column() int
}

Token are results of `Lexer.Lex`. Entity of `Value` depends on `Kind`.

Jump to

Keyboard shortcuts

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