parser

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EOF = rune(0)

EOF signals the end of a file.

Functions

This section is empty.

Types

type Error

type Error struct {
	Pos int
	Msg string
}

Error represents a parser error.

func (Error) Error

func (e Error) Error() string

Error implements (error).Error

type ErrorList

type ErrorList []*Error

ErrorList represents a list of parser errors.

func (ErrorList) Error

func (l ErrorList) Error() string

ErrorList implements (error).Error

func (*ErrorList) Push

func (p *ErrorList) Push(err *Error)

Add adds a new parser error to the collection.

type Parser

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

Parser represents a parser.

func New

func New(r io.Reader) *Parser

New returns a new instance of Parser.

func (*Parser) Parse

func (p *Parser) Parse() (exprs []ast.Expr, err error)

Parse parses a selector.

type Scanner

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

Scanner represents a lexical scanner.

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) Scan

func (s *Scanner) Scan() ast.Node

Scan reads the next token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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