token

package
v0.0.0-...-f82cdda Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Push      = "PUSH"
	Duplicate = "DUPLICATE"

	Sum      = "SUM"
	Divide   = "DIV"
	Subtract = "SUB"
	Multiply = "MUL"

	Label = "LABEL"

	Comment = "COMMENT"

	Jump       = "JUMP"
	JumpIfTrue = "JUMP_IF_TRUE"

	Equal = "EQUAL"

	EndOfLine = "END_OF_FILE"

	Identifier = "IDENTIFIER"
	Number     = "NUMBER"
)

Variables

This section is empty.

Functions

func IsPartOfFloat

func IsPartOfFloat(c rune) bool

func IsPartOfIdentifier

func IsPartOfIdentifier(c rune) bool

func IsPartOfNumber

func IsPartOfNumber(c rune) bool

func IsStartOfIdentifier

func IsStartOfIdentifier(c rune) bool

func IsWhitespace

func IsWhitespace(c rune) bool

Types

type IndentValue

type IndentValue struct {
	Name string
	Hash uint32
}

type Kind

type Kind string

type Token

type Token struct {
	TokenValue

	Kind Kind

	LineStart    int
	CollumnStart int

	LineEnd    int
	CollumnEnd int
}

func (*Token) DebugPrint

func (t *Token) DebugPrint()

func (*Token) DetectMyKind

func (t *Token) DetectMyKind()

func (*Token) DetectMyString

func (t *Token) DetectMyString() string

func (*Token) SetIndentValue

func (t *Token) SetIndentValue(s string)

type TokenValue

type TokenValue struct {
	IndentValue
	IntegerValue int
	FloatValue   float64
	StringValue  string
}

Jump to

Keyboard shortcuts

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