token

package
v0.0.0-...-5e4a643 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INT       = "INT"
	STRING    = "STRING"
	FLOAT     = "FLOAT"
	EOL       = "EOL"
	EOF       = "EOF"
	COMMENT   = "COMMENT"
	LabelName = "LABEL_NAME"
	LABEL     = "LABEL"
	ILLEGAL   = "ILLEGAL"
	// Instructions
	ICONST = "ICONST"
	SCONST = "SCONST"
	FCONST = "FCONST"
	IADD   = "IADD"
	ISUB   = "ISUB"
	IMUL   = "IMUL"
	IDIV   = "IDIV"
	JMP    = "JMP"
	JMPT   = "JMPT"
	JMPF   = "JMPF"
	IEQ    = "IEQ"
	ILT    = "ILT"
	COPY   = "COPY"
	GLOAD  = "GLOAD"
	GSTORE = "GSTORE"
	LOAD   = "LOAD"
	STORE  = "STORE"
	CALL   = "CALL"
	RET    = "RET"
	PRINT  = "PRINT"
	PRINTC = "PRINTC"
	HALT   = "HALT"
)

Types

Variables

This section is empty.

Functions

This section is empty.

Types

type TokType

type TokType string

func LookupInstruction

func LookupInstruction(instruction string) TokType

type Token

type Token struct {
	Type       TokType
	Literal    string
	LineNumber int
	Index      int
}

Jump to

Keyboard shortcuts

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