lex

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const EOF = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Typ   ItemType
	Pos   int
	Value string
}

type ItemType

type ItemType int
const (
	ItemString ItemType = iota
	ItemBool
	ItemInteger
	ItemFloat
	ItemNil
	ItemKey
	ItemLeftBrace
	ItemRightBrace
	ItemLeftSqrBrace
	ItemRightSqrBrace
	ItemComma
	ItemColon
	ItemEOF
	ItemError
)

type Lexer

type Lexer struct {
	Name  string
	Input string
	Pos   int
	Start int
	Width int
	Items chan Item
}

func Lex

func Lex(name, json string) *Lexer

func (*Lexer) NextItem

func (l *Lexer) NextItem() Item

Jump to

Keyboard shortcuts

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