scanner

package
v0.0.0-...-239939c Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EOF       = "#eof"
	ALPHABET  = "#alphabetic"
	DIGIT     = "#digit"
	BIN       = "#binary"
	SPEC      = "#special"
	SEPARATOR = "#separator"

	BOOLEAN = "boolean"
	NIL     = "nil"
	STRING  = "string"
	NUMBER  = "number"
	IDENT   = "identifier"
	SYMBOL  = "symbol"
	ARRAY   = "array"
	KEYWORD = "keyword"
)

Variables

This section is empty.

Functions

func CharToNum

func CharToNum(r rune) int

Types

type AssignmentToken

type AssignmentToken struct {
	*Token
}

func (*AssignmentToken) IsAssignment

func (t *AssignmentToken) IsAssignment() bool

type BinarySelectorToken

type BinarySelectorToken struct {
	*ValueToken
}

func NewBinarySelectorToken

func NewBinarySelectorToken(start int64, value string) *BinarySelectorToken

func (*BinarySelectorToken) IsBinary

func (t *BinarySelectorToken) IsBinary() bool

type EOFToken

type EOFToken struct {
	*Token
}

func (*EOFToken) TypeOfToken

func (t *EOFToken) TypeOfToken() string

type IdentifierToken

type IdentifierToken struct {
	*ValueToken
}

func (*IdentifierToken) IsIdentifier

func (i *IdentifierToken) IsIdentifier() bool

type KeywordToken

type KeywordToken struct {
	*ValueToken
}

func (*KeywordToken) IsKeyword

func (k *KeywordToken) IsKeyword() bool

type LiteralArrayToken

type LiteralArrayToken struct {
	*ValueToken
}

func (*LiteralArrayToken) IsForByteArray

func (t *LiteralArrayToken) IsForByteArray() bool

func (*LiteralArrayToken) IsLiteralArrayToken

func (t *LiteralArrayToken) IsLiteralArrayToken() bool

type LiteralToken

type LiteralToken struct {
	*ValueToken
	// contains filtered or unexported fields
}

func NewLiteralToken

func NewLiteralToken(start int64, stop int64, value string, valueType string) *LiteralToken

func (*LiteralToken) IsLiteralToken

func (l *LiteralToken) IsLiteralToken() bool

func (*LiteralToken) IsMultiKeyword

func (t *LiteralToken) IsMultiKeyword() bool

type LiteralTokenInterface

type LiteralTokenInterface interface {
	ValueTokenInterface
	IsMultiKeyword() bool
}

type MultiKeywordLiteralToken

type MultiKeywordLiteralToken struct {
	*LiteralToken
}

func (*MultiKeywordLiteralToken) IsMultiKeyword

func (m *MultiKeywordLiteralToken) IsMultiKeyword() bool

type NumberLiteralToken

type NumberLiteralToken struct {
	*LiteralToken
}

type Scanner

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

func New

func New(input talkio.StringReader) *Scanner

func (*Scanner) Next

func (s *Scanner) Next() (TokenInterface, error)

type SpecialCharacterToken

type SpecialCharacterToken struct {
	*ValueToken
}

func (*SpecialCharacterToken) IsSpecial

func (s *SpecialCharacterToken) IsSpecial() bool

type Token

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

func (*Token) GetStart

func (t *Token) GetStart() int64

func (*Token) GetStop

func (t *Token) GetStop() int64

func (*Token) IsAssignment

func (t *Token) IsAssignment() bool

func (*Token) IsBinary

func (t *Token) IsBinary() bool

func (*Token) IsForByteArray

func (t *Token) IsForByteArray() bool

func (*Token) IsIdentifier

func (t *Token) IsIdentifier() bool

func (*Token) IsKeyword

func (t *Token) IsKeyword() bool

func (*Token) IsLiteralArrayToken

func (t *Token) IsLiteralArrayToken() bool

func (*Token) IsLiteralToken

func (t *Token) IsLiteralToken() bool

func (*Token) IsSpecial

func (t *Token) IsSpecial() bool

func (*Token) SetStart

func (t *Token) SetStart(start int64)

func (*Token) TypeOfToken

func (t *Token) TypeOfToken() string

type TokenInterface

type TokenInterface interface {
	TypeOfToken() string

	GetStart() int64
	SetStart(int64)
	GetStop() int64
	IsBinary() bool
	IsIdentifier() bool
	IsSpecial() bool
	IsAssignment() bool
	IsLiteralToken() bool
	IsLiteralArrayToken() bool
	IsKeyword() bool
	IsForByteArray() bool
	// contains filtered or unexported methods
}

type ValueToken

type ValueToken struct {
	*Token
	// contains filtered or unexported fields
}

func (*ValueToken) SetValue

func (t *ValueToken) SetValue(value string)

func (*ValueToken) TypeOfToken

func (t *ValueToken) TypeOfToken() string

func (*ValueToken) ValueOfToken

func (t *ValueToken) ValueOfToken() string

type ValueTokenInterface

type ValueTokenInterface interface {
	TokenInterface
	ValueOfToken() string
}

Jump to

Keyboard shortcuts

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