lexer

package
v0.0.0-...-f3cf089 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 2 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 NewLexer

func NewLexer(input string) *Lexer

func (*Lexer) NextToken

func (l *Lexer) NextToken() Token

type Token

type Token struct {
	Kind TokenKind

	Value interface{}
}

type TokenIdentifier

type TokenIdentifier struct {
	Identifier string
}

type TokenInteger

type TokenInteger struct {
	Value uint64
}

type TokenKind

type TokenKind uint32
const (
	Unknown TokenKind = iota

	Identifier
	Integer

	Plus
	Minus
	Multiply
	Divide

	OpenBrace
	CloseBrace

	OpenBracket
	CloseBracket

	OpenParen
	CloseParen

	EndOfStream
)

func (TokenKind) String

func (i TokenKind) String() string

Jump to

Keyboard shortcuts

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