lexer

package
v0.0.0-...-fbd2d13 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: MIT Imports: 8 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
}

Lexer represents a lexical scanner for Lox programing language.

func New

func New(input string) *Lexer

New return an instance of Lexer.

func (*Lexer) NextToken

func (l *Lexer) NextToken() (tok token.Token, literal string)

NextToken reads and returns token and literal. It returns token.Illegal for invalid string or number. It return token.EOF at the end of input string.

func (*Lexer) Pos

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

Pos returns current position of lexer.

Jump to

Keyboard shortcuts

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