lexer

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

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

Go to latest
Published: Jun 4, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Eraser

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

Eraser wraps a Stream removing position information from tokens

Commonly used for testing

func NoPos

func NoPos(s Stream) Eraser

func (Eraser) Lex

func (e Eraser) Lex() token.Token

type Lexer

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

func FromBytes

func FromBytes(b []byte) (s *Lexer)

func FromFile

func FromFile(filename string) (s *Lexer, err error)

func FromReader

func FromReader(r io.Reader) (s *Lexer, err error)

func (*Lexer) Lex

func (s *Lexer) Lex() token.Token

type Parrot

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

Parrot implements Stream by yielding tokens from supplied list

func FromTokens

func FromTokens(toks []token.Token) *Parrot

func (*Parrot) Lex

func (p *Parrot) Lex() token.Token

type Quiet

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

Quiet wraps a Stream removing tokens with comments

Commonly used for testing

func NoComments

func NoComments(s Stream) Quiet

func (Quiet) Lex

func (q Quiet) Lex() token.Token

type Stream

type Stream interface {
	Lex() token.Token
}

Jump to

Keyboard shortcuts

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