lexer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 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 Lexeme

type Lexeme struct {
	Type  LexemeType
	Value string
	Pos   position
}

func (Lexeme) String

func (l Lexeme) String() string

type LexemeType

type LexemeType int
const (
	LexemeError LexemeType = iota
	LexemeComment
	LexemeMarkerStart
	LexemeScope
	LexemeSeparator
	LexemeArg
	LexemeStringLiteral
	LexemeFloatLiteral
	LexemeIntegerLiteral
	LexemeBoolLiteral
	LexemeSliceBegin
	LexemeSliceEnd
	LexemeSliceDelimiter
	LexemeNakedSliceDelimiter
	LexemeMarkerEnd
	LexemeWarning
	LexemeEOF
)

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

Lexer holds the state of the scanner.

func NewLexer

func NewLexer(r io.Reader) *Lexer

NewLexer creates a new lexer for the input reader.

func (*Lexer) NextLexeme

func (l *Lexer) NextLexeme() Lexeme

NextLexeme returns the next item from the input.

func (*Lexer) Run

func (l *Lexer) Run()

Run runs the lexer until eof or until it encounters an error.

Jump to

Keyboard shortcuts

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