lexer

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

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

func FromReader

func FromReader(input io.Reader, fileName string) *Lexer

Creates a new Lexer from an input io.Reader, with the given file name

func FromString

func FromString(input string) *Lexer

Creates a new Lexer from an input string

func (*Lexer) NextToken

func (lexer *Lexer) NextToken() token.Token

Produces the next token from the lexer

func (*Lexer) Pos

func (lexer *Lexer) Pos() scanner.Position

Returns the current position of the scanner

func (*Lexer) RemainingTokens

func (lexer *Lexer) RemainingTokens() ([]token.Token, error)

Consumes the remaining tokens from the lexer until EOF is reached, and returns them in a slice

Jump to

Keyboard shortcuts

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