parsley

package module
v0.0.0-...-0682bad Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 5 Imported by: 0

README

parsley

DSL parser

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEOF

func IsEOF(item Item) bool

func IsNumber

func IsNumber(r rune) bool

func IsSpace

func IsSpace(r rune) bool

Types

type Item

type Item struct {
	Type  string
	Value []byte
}
var EOF Item = Item{"eof", nil}

type Lexer

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

func Lex

func Lex(s StateFunc, input []byte) *Lexer

func (*Lexer) Accept

func (l *Lexer) Accept(valid string) (bool, error)

func (*Lexer) AcceptFunc

func (l *Lexer) AcceptFunc(f func(rune) bool) (bool, error)

func (*Lexer) AcceptRun

func (l *Lexer) AcceptRun(valid string) (n int, err error)

func (*Lexer) AcceptRunFunc

func (l *Lexer) AcceptRunFunc(f func(rune) bool) (n int, err error)

func (*Lexer) Backup

func (l *Lexer) Backup()

func (*Lexer) EOF

func (l *Lexer) EOF() bool

func (*Lexer) Emit

func (l *Lexer) Emit(itemType string)

func (*Lexer) Errorf

func (l *Lexer) Errorf(next StateFunc, format string, args ...any) StateFunc

func (*Lexer) Fatalf

func (l *Lexer) Fatalf(format string, args ...any) StateFunc

func (*Lexer) Ignore

func (l *Lexer) Ignore()

func (*Lexer) Next

func (l *Lexer) Next() (r rune, err error)

func (*Lexer) NextItem

func (l *Lexer) NextItem() (item Item)

func (*Lexer) Peek

func (l *Lexer) Peek() (r rune, err error)

func (*Lexer) Run

func (l *Lexer) Run() []byte

type StateFunc

type StateFunc func(*Lexer) StateFunc

Jump to

Keyboard shortcuts

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