token

package
v0.0.0-...-635c4a0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIST_START = iota
	LIST_END
	STRING
	INT
	STATEMENT
	BOOL
	EOF
)

Variables

This section is empty.

Functions

func Compare

func Compare(a, b Token) bool

Types

type List

type List struct {
	Tokens   []Token
	Position int
}

func NewList

func NewList(tokens []Token) *List

func (*List) Append

func (tl *List) Append(t Token)

func (*List) Length

func (tl *List) Length() int

func (*List) ReadToken

func (tl *List) ReadToken() Token

func (*List) Reset

func (tl *List) Reset()

func (*List) String

func (tl *List) String() string

type Token

type Token struct {
	Type TokenType
	Text string
}

func End

func End() Token

func Eof

func Eof() Token

func False

func False() Token

func Int

func Int(s string) Token

func Start

func Start() Token

func Statement

func Statement(s string) Token

func String

func String(s string) Token

func True

func True() Token

func (Token) String

func (t Token) String() string

type TokenType

type TokenType int

func (TokenType) String

func (tt TokenType) String() string

Jump to

Keyboard shortcuts

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