token

package
v0.0.0-...-90e8e0c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package token defines the tokens for kl lexers.

Index

Constants

This section is empty.

Variables

View Source
var Tokens = [...]string{}/* 105 elements not displayed */
View Source
var Variables []Token

All available variables.

Functions

func NormalizeString

func NormalizeString(s string) string

NormalizeString makes sure the string will be usable as a file name.

Types

type Token

type Token uint8
const (
	Invalid Token = iota

	R0
	R1
	R2
	R3
	R4
	R5
	R6
	R7
	R8
	R9

	SR0
	SR1
	SR2
	SR3
	SR4
	SR5
	SR6
	SR7
	SR8
	SR9

	RA
	RB
	RC
	RD
	RBP
	RSP

	U8
	U16
	U32
	U64
	Pointer

	S8
	S16
	S32
	S64

	If
	Else
	EndIf
	Switch
	SwitchCase
	SwitchCaseSep
	EndSwitch
	Call
	Goto
	Return
	Embed
	Asm

	While
	EndWhile
	For
	EndFor
	Const
	Pub
	Test

	Len
	Size

	PlusPrefix
	MinusPrefix

	StringPrefix
	UnsignedArrayPrefix
	SignedArrayPrefix
	StringArrayPrefix
	CharArrayPrefix

	Dot
	Colon
	Semicolon
	Hash
	At
	Star
	BracketLeft
	BracketRight
	ParenLeft
	ParenRight
	CurlyLeft
	CurlyRight
	CallInput
	CallOutput
	Newline

	Assign
	AssignAdd
	AssignSub
	AssignMul
	AssignDiv
	AssignAnd
	AssignOr
	AssignXor
	AssignNot
	AssignAndNot
	AssignShiftLeft
	AssignShiftRight

	Equal
	NotEqual
	LessThan
	LessThanEqual
	GreaterThan
	GreaterThanEqual

	Exit
	Syscall
	Push
	Pop
	Assert
	Panic
	Print
	Min
	Max

	String
	// Lexer specific, do not use as types.
	Identifier
	Unsigned
	Space
	EOF
	Error

	// Package file (kl.pkg) specific tokens.
	Name
	Description
	Import
)

func (Token) CmpOpposite

func (tok Token) CmpOpposite() Token

func (Token) IsAssign

func (tok Token) IsAssign() bool

func (Token) IsBuiltin

func (tok Token) IsBuiltin() bool

func (Token) IsCmp

func (tok Token) IsCmp() bool

func (Token) IsKeyword

func (tok Token) IsKeyword() bool

func (Token) IsPrefix

func (tok Token) IsPrefix() bool

func (Token) IsSign

func (tok Token) IsSign() bool

func (Token) IsSigned

func (tok Token) IsSigned() bool

func (Token) IsType

func (tok Token) IsType() bool

func (Token) IsUnsigned

func (tok Token) IsUnsigned() bool

func (Token) IsVar

func (tok Token) IsVar() bool

func (Token) IsVarReserved

func (tok Token) IsVarReserved() bool

func (Token) IsVarString

func (tok Token) IsVarString() bool

func (Token) String

func (tok Token) String() string

func (Token) VarStringToVar

func (tok Token) VarStringToVar() Token

Jump to

Keyboard shortcuts

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