lexer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iteratee

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

An Iteratee contains a collection of token from a Lexer.

func (Iteratee) HasNext

func (it Iteratee) HasNext() bool

HasNext defines if a token is available.

func (Iteratee) Is

func (it Iteratee) Is(next token.Type) bool

Is defines if next token has given type.

func (*Iteratee) Next

func (it *Iteratee) Next() token.Token

Next returns the next token.

type Lexer

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

A Lexer will return a list of Token from a reader.

func New

func New(input io.Reader) Lexer

New return a new Lexer from given source.

func (*Lexer) Iterator

func (l *Lexer) Iterator() *Iteratee

Iterator returns an Iteratee from reader.

func (*Lexer) Next

func (l *Lexer) Next() token.Token

Next will return the next token on reader.

Jump to

Keyboard shortcuts

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