lexer

package
v0.0.0-...-a0dbdbd Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

generated by goGen.go - do not edit

generated by goGen.go - do not edit

generated by goGen.go - do not edit

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Automata

type Automata interface {
	RunGreedy(iter CharIterator) error
}

Automata

type CharIterator

type CharIterator interface {
	CurrentIndex() int
	NextChar() rune
	Peek() rune
	SetIndex(i int)
	SubString(l int, r int) []rune
	Loc(idx int) struct {
		Line int
		Col  int
	}
}

character reader

type CharStream

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

Character reader implement

func NewStream

func NewStream(input string) *CharStream

func (*CharStream) CurrentIndex

func (cs *CharStream) CurrentIndex() int

func (*CharStream) Loc

func (cs *CharStream) Loc(idx int) struct {
	Line int
	Col  int
}

func (*CharStream) NextChar

func (cs *CharStream) NextChar() rune

func (*CharStream) Peek

func (cs *CharStream) Peek() rune

func (*CharStream) SetIndex

func (cs *CharStream) SetIndex(i int)

func (*CharStream) SubString

func (cs *CharStream) SubString(from int, limit int) []rune

type Lexer

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

Lexer

func NewLexer

func NewLexer(chars CharIterator) *Lexer

func (*Lexer) HasNext

func (l *Lexer) HasNext() bool

func (*Lexer) NextToken

func (l *Lexer) NextToken() (t *Token, err error)

type Token

type Token struct {
	Type  TokenType
	Token TokenValue
}

type TokenType

type TokenType string

Token

type TokenValue

type TokenValue string

Jump to

Keyboard shortcuts

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