lexer

package
v0.0.0-...-eb1d485 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemEOF ItemType = iota
	ItemEOL
	ItemError
	ItemDecimal
	ItemHexadecimal
	ItemOctal
	ItemOperator

	ErrorExpectedNumber           string = "expected a number"
	ErrorExpectedOperator         string = "expected an operator"
	ErrorHexadecimalNoDigits      string = "hexadecimal has no digits"
	ErrorHexadecimalNeedsExponent string = "hexadecimal needs exponent"
	ErrorExponentNoDigits         string = "exponent has no digits"
	ErrorInvalidOctalDigit        string = "invalid octal digit"
	ErrorUnexpectedCharacter      string = "unexpected character"
)

Variables

This section is empty.

Functions

func Lex

func Lex(input string) chan Item

Types

type FilePos

type FilePos struct {
	X, Y int
}

type Item

type Item struct {
	Pos   FilePos
	Type  ItemType
	Value string
}

func (Item) String

func (item Item) String() string

type ItemType

type ItemType int

func (ItemType) String

func (i ItemType) String() string

Jump to

Keyboard shortcuts

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