lexer

package
v0.0.0-...-1e04c87 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package lexer handles the interpreter's first phase of operation. Lexer takes some input and interpret it into 'tokens'.

Smoosh (and Monkey) builds up its input into an ordered list of tokens without attmpting to make sense of the structure and relationship. These tokens are operators, keywords, identifiers or values (strings, numbers, etc).

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 tokenises input

func New

func New(input string) *Lexer

New creates and initialises a new lexer

func (*Lexer) NextToken

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

NextToken attempts to find the next token in the program's input

Jump to

Keyboard shortcuts

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