ast

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: 7 Imported by: 0

Documentation

Overview

Package ast defines the types for kl source files trees.

Index

Constants

View Source
const (
	SourceExt   FileExtension = ".kl"
	TestExt     FileExtension = ".klt"
	PackageFile               = "kl.pkg"
	// TestingPkg is the name of the package used when writing tests,
	// to access the content of the tested package.
	TestingPkg = "testing"
	// BuiltinsFilesGlobal is the name for the kl global that holds the files
	// making up a package. It is inserted by Sema.
	BuiltinsFilesGlobal      = "builtins_files"
	BuiltinsStackStartGlobal = "builtins_stack_start"
	InternPackageTag         = "kl_intern_strings"
)

Variables

This section is empty.

Functions

func ElementTypeOf

func ElementTypeOf(value Value) token.Token

func IsValueArray

func IsValueArray(value Value) bool

func IsValueComposite

func IsValueComposite(value Value) bool

A composite is one of: ValueUnsignedArray, ValueSignedArray, ValueStringArray, ValueEmbed, ValueString

func IsValueScalar

func IsValueScalar(value Value) bool

Types

type Comment

type Comment struct {
	Location
	Comment string
}

func (Comment) String

func (ct Comment) String() string

type Condition

type Condition struct {
	Location
	Left  Value
	Op    token.Token
	Right Value
}

It is garanteed that Left or Right has a valid type. If both have a type, they have the same one.

func (Condition) Not

func (c Condition) Not() Condition

func (Condition) String

func (cd Condition) String() string

type Error

type Error struct {
	Tag      string
	Location Location
	Err      error
}

func (Error) Error

func (e Error) Error() string

type FileExtension

type FileExtension string

type GlobalTag

type GlobalTag uint8
const (
	Constant GlobalTag = 1 << iota
	Public
	InUse
)

func (GlobalTag) Has

func (st GlobalTag) Has(state GlobalTag) bool

func (GlobalTag) String

func (st GlobalTag) String() string

type LabelTag

type LabelTag uint8
const (
	TestLabel LabelTag = 1 << iota
	PublicLabel
)

func (LabelTag) Has

func (st LabelTag) Has(state LabelTag) bool

func (LabelTag) String

func (st LabelTag) String() string

type Location

type Location struct {
	File   string
	Offset uint32
}

func (Location) Loc

func (loc Location) Loc() Location

func (Location) Pos

func (loc Location) Pos(files []string) Position

func (Location) String

func (loc Location) String() string

type Param

type Param struct {
	Var         token.Token
	Description string
}

type Position

type Position uint64

func (Position) FileIndex

func (p Position) FileIndex() uint32

func (Position) Offsett

func (p Position) Offsett() uint32

func (Position) SkipStack

func (p Position) SkipStack() uint32

type Stmt

type Stmt interface {
	String() string
	Loc() Location
	TrailingComment() Comment
	// contains filtered or unexported methods
}

type StmtAsm

type StmtAsm struct {
	Location
	Comment Comment
	Asm     string
}

StmtAsm allows inserting assembly code as is. TODO dependent on the backend and platform

func (StmtAsm) String

func (st StmtAsm) String() string

func (StmtAsm) TrailingComment

func (s StmtAsm) TrailingComment() Comment

type StmtAssign

type StmtAssign struct {
	Location
	Comment Comment
	Var     token.Token
	Op      token.Token
	Value   Value // !IsValueArray()
}

Assign a literal to a variable. e.g. r2 = 10u16

func (StmtAssign) String

func (st StmtAssign) String() string

func (StmtAssign) TrailingComment

func (s StmtAssign) TrailingComment() Comment

type StmtAssignDiv

type StmtAssignDiv struct {
	Location
	Comment   Comment
	Quotient  token.Token
	Remainder token.Token
	Value     Value
}

func (StmtAssignDiv) String

func (st StmtAssignDiv) String() string

func (StmtAssignDiv) TrailingComment

func (s StmtAssignDiv) TrailingComment() Comment

type StmtAssignGlobal

type StmtAssignGlobal struct {
	Location
	Comment Comment
	Symbol  Symbol
	Value   Value
}

Assign a literal to a global declaration (non array). e.g. @x = 10u16

func (StmtAssignGlobal) String

func (st StmtAssignGlobal) String() string

func (StmtAssignGlobal) TrailingComment

func (s StmtAssignGlobal) TrailingComment() Comment

type StmtAssignGlobalByIndex

type StmtAssignGlobalByIndex struct {
	Location
	Comment Comment
	Symbol  Symbol
	Index   uint64
	Value   Value
}

Assign a literal to a global declaration. e.g. @x[2] = 10u16

func (StmtAssignGlobalByIndex) String

func (st StmtAssignGlobalByIndex) String() string

func (StmtAssignGlobalByIndex) TrailingComment

func (s StmtAssignGlobalByIndex) TrailingComment() Comment

type StmtAssignGlobalByVar

type StmtAssignGlobalByVar struct {
	Location
	Comment Comment
	Symbol  Symbol
	Var     token.Token
	Value   Value
}

Assign a variable to a global declaration. e.g. @x[r2] = r0

func (StmtAssignGlobalByVar) String

func (st StmtAssignGlobalByVar) String() string

func (StmtAssignGlobalByVar) TrailingComment

func (s StmtAssignGlobalByVar) TrailingComment() Comment

type StmtAssignMem

type StmtAssignMem struct {
	Location
	Comment Comment
	Var     token.Token
	Value   Value
}

Assign a literal to a variable. e.g. *r2 = 10 u16

func (StmtAssignMem) String

func (st StmtAssignMem) String() string

func (StmtAssignMem) TrailingComment

func (s StmtAssignMem) TrailingComment() Comment

type StmtAssignMinMax

type StmtAssignMinMax struct {
	Location
	Comment Comment
	Var     token.Token
	Op      token.Token
	V1      Value
	V2      Value
}

func (StmtAssignMinMax) String

func (st StmtAssignMinMax) String() string

func (StmtAssignMinMax) TrailingComment

func (s StmtAssignMinMax) TrailingComment() Comment

type StmtBuiltinAssert

type StmtBuiltinAssert struct {
	Location
	Comment   Comment
	Condition Condition
	Arguments []Value
}

func (StmtBuiltinAssert) String

func (st StmtBuiltinAssert) String() string

func (StmtBuiltinAssert) TrailingComment

func (s StmtBuiltinAssert) TrailingComment() Comment

type StmtBuiltinExit

type StmtBuiltinExit struct {
	Location
	Comment Comment
	Code    Value
}

func (StmtBuiltinExit) String

func (st StmtBuiltinExit) String() string

func (StmtBuiltinExit) TrailingComment

func (s StmtBuiltinExit) TrailingComment() Comment

type StmtBuiltinPanic

type StmtBuiltinPanic struct {
	Location
	Comment   Comment
	Arguments []Value
}

func (StmtBuiltinPanic) String

func (st StmtBuiltinPanic) String() string

func (StmtBuiltinPanic) TrailingComment

func (s StmtBuiltinPanic) TrailingComment() Comment

type StmtBuiltinPop

type StmtBuiltinPop struct {
	Location
	Comment Comment
	Vars    []token.Token
}

func (StmtBuiltinPop) String

func (st StmtBuiltinPop) String() string

func (StmtBuiltinPop) TrailingComment

func (s StmtBuiltinPop) TrailingComment() Comment

type StmtBuiltinPrint

type StmtBuiltinPrint struct {
	Location
	Comment   Comment
	Arguments []Value
}

func (StmtBuiltinPrint) String

func (st StmtBuiltinPrint) String() string

func (StmtBuiltinPrint) TrailingComment

func (s StmtBuiltinPrint) TrailingComment() Comment

type StmtBuiltinPush

type StmtBuiltinPush struct {
	Location
	Comment Comment
	Vars    []token.Token
}

func (StmtBuiltinPush) String

func (st StmtBuiltinPush) String() string

func (StmtBuiltinPush) TrailingComment

func (s StmtBuiltinPush) TrailingComment() Comment

type StmtBuiltinPushValue

type StmtBuiltinPushValue struct {
	Location
	Comment Comment
	Value   Value
}

func (StmtBuiltinPushValue) String

func (st StmtBuiltinPushValue) String() string

func (StmtBuiltinPushValue) TrailingComment

func (s StmtBuiltinPushValue) TrailingComment() Comment

type StmtBuiltinSyscall

type StmtBuiltinSyscall struct {
	Location
	Comment   Comment
	Arguments []Value
}

func (StmtBuiltinSyscall) String

func (st StmtBuiltinSyscall) String() string

func (StmtBuiltinSyscall) TrailingComment

func (s StmtBuiltinSyscall) TrailingComment() Comment

type StmtCall

type StmtCall struct {
	Location
	Comment   Comment
	Symbol    Symbol
	SavedVars int // set by sema
}

func (StmtCall) String

func (st StmtCall) String() string

func (StmtCall) TrailingComment

func (s StmtCall) TrailingComment() Comment

type StmtComment

type StmtComment struct {
	Comment
}

func (StmtComment) TrailingComment

func (s StmtComment) TrailingComment() Comment

type StmtEOF

type StmtEOF struct{}

StmtEOF indicates the end of statements for a file.

func (StmtEOF) Loc

func (st StmtEOF) Loc() Location

func (StmtEOF) String

func (st StmtEOF) String() string

func (StmtEOF) TrailingComment

func (s StmtEOF) TrailingComment() Comment

type StmtElse

type StmtElse struct {
	Location // must be properly set for codegen
	Comment  Comment
}

func (StmtElse) String

func (st StmtElse) String() string

func (StmtElse) TrailingComment

func (s StmtElse) TrailingComment() Comment

type StmtEndFor

type StmtEndFor struct {
	Location
	Comment Comment
}

func (StmtEndFor) String

func (st StmtEndFor) String() string

func (StmtEndFor) TrailingComment

func (s StmtEndFor) TrailingComment() Comment

type StmtEndIf

type StmtEndIf struct {
	Location
	Comment Comment
}

func (StmtEndIf) String

func (st StmtEndIf) String() string

func (StmtEndIf) TrailingComment

func (s StmtEndIf) TrailingComment() Comment

type StmtEndSwitch

type StmtEndSwitch struct {
	Location
	Comment Comment
}

func (StmtEndSwitch) String

func (st StmtEndSwitch) String() string

func (StmtEndSwitch) TrailingComment

func (s StmtEndSwitch) TrailingComment() Comment

type StmtEndWhile

type StmtEndWhile struct {
	Location
	Comment Comment
}

func (StmtEndWhile) String

func (st StmtEndWhile) String() string

func (StmtEndWhile) TrailingComment

func (s StmtEndWhile) TrailingComment() Comment

type StmtFor

type StmtFor struct {
	Location
	Comment   Comment
	Composite Value // IsValueComposite() ||
	// IsValueComposite(ValueFromGlobal.Value) ||
	// ValueFromGlobalArrayByIndex is ValueString ||
	// ValueFromGlobalArrayByVar is ValueString
	Value token.Token
	Index token.Token
}

func (StmtFor) String

func (st StmtFor) String() string

func (StmtFor) TrailingComment

func (s StmtFor) TrailingComment() Comment

type StmtGlobal

type StmtGlobal struct {
	Location
	Comment Comment
	Name    string
	State   GlobalTag
	Value   Value // ValueUnsigned, ValueUnsignedArray, ValueSigned, ValueSignedArray, ValueString, ValueStringArray, ValueEmbed
}

Global declaration.

func (StmtGlobal) String

func (st StmtGlobal) String() string

func (StmtGlobal) TrailingComment

func (s StmtGlobal) TrailingComment() Comment

type StmtGoto

type StmtGoto struct {
	Location
	Comment Comment
	Label   string
}

func (StmtGoto) String

func (st StmtGoto) String() string

func (StmtGoto) TrailingComment

func (s StmtGoto) TrailingComment() Comment

type StmtIf

type StmtIf struct {
	Location  // must be properly set for codegen
	Comment   Comment
	Condition Condition
}

func (StmtIf) String

func (st StmtIf) String() string

func (StmtIf) TrailingComment

func (s StmtIf) TrailingComment() Comment

type StmtImport

type StmtImport struct {
	Location
	Comment Comment
	// Tag defines the namespace for the import.
	// It can be empty, in which case special care of duplicate identifiers need to be taken.
	Tag string
	// Name identifies a package resource:
	// - directory on the local filesystem, absolute or relative to the file this statement is contained
	// - url (TODO)
	Name string
}

func (StmtImport) String

func (st StmtImport) String() string

func (StmtImport) TrailingComment

func (s StmtImport) TrailingComment() Comment

type StmtLabel

type StmtLabel struct {
	Location
	Comment Comment
	Name    string
}

func (StmtLabel) String

func (st StmtLabel) String() string

func (StmtLabel) TrailingComment

func (s StmtLabel) TrailingComment() Comment

type StmtLabelCallable

type StmtLabelCallable struct {
	Location
	Comment Comment
	Name    string
	Tag     LabelTag
	Input   []Param
	Output  []Param
}

func (StmtLabelCallable) String

func (st StmtLabelCallable) String() string

func (StmtLabelCallable) TrailingComment

func (s StmtLabelCallable) TrailingComment() Comment

type StmtNewline

type StmtNewline struct{}

func (StmtNewline) Loc

func (st StmtNewline) Loc() Location

func (StmtNewline) String

func (st StmtNewline) String() string

func (StmtNewline) TrailingComment

func (s StmtNewline) TrailingComment() Comment

type StmtNoop

type StmtNoop struct{}

func (StmtNoop) Loc

func (st StmtNoop) Loc() Location

func (StmtNoop) String

func (st StmtNoop) String() string

func (StmtNoop) TrailingComment

func (s StmtNoop) TrailingComment() Comment

type StmtReturn

type StmtReturn struct {
	Location
	Comment Comment
}

func (StmtReturn) String

func (st StmtReturn) String() string

func (StmtReturn) TrailingComment

func (s StmtReturn) TrailingComment() Comment

type StmtSwitch

type StmtSwitch struct {
	Location
	Comment Comment
	Value   Value
}

func (StmtSwitch) String

func (st StmtSwitch) String() string

func (StmtSwitch) TrailingComment

func (s StmtSwitch) TrailingComment() Comment

type StmtSwitchCase

type StmtSwitchCase struct {
	Location
	Comment Comment
	Value   Value
}

func (StmtSwitchCase) String

func (st StmtSwitchCase) String() string

func (StmtSwitchCase) TrailingComment

func (s StmtSwitchCase) TrailingComment() Comment

type StmtSwitchCaseDefault

type StmtSwitchCaseDefault struct {
	Location
	Comment Comment
}

func (StmtSwitchCaseDefault) String

func (st StmtSwitchCaseDefault) String() string

func (StmtSwitchCaseDefault) TrailingComment

func (s StmtSwitchCaseDefault) TrailingComment() Comment

type StmtVarDec

type StmtVarDec struct {
	Location
	Comment Comment
	Var     token.Token
}

func (StmtVarDec) String

func (st StmtVarDec) String() string

func (StmtVarDec) TrailingComment

func (s StmtVarDec) TrailingComment() Comment

type StmtVarInc

type StmtVarInc struct {
	Location
	Comment Comment
	Var     token.Token
}

func (StmtVarInc) String

func (st StmtVarInc) String() string

func (StmtVarInc) TrailingComment

func (s StmtVarInc) TrailingComment() Comment

type StmtWhile

type StmtWhile struct {
	Location
	Comment   Comment
	Condition Condition
}

func (StmtWhile) String

func (st StmtWhile) String() string

func (StmtWhile) TrailingComment

func (s StmtWhile) TrailingComment() Comment

type Symbol

type Symbol struct {
	Location
	// Pkg name, empty if local.
	Pkg  string
	Name string
}

Symbol defines a (potentially external to the package) reference to a label.

func InternStringSymbol

func InternStringSymbol(str string) Symbol

InternStringID returns the label to use for codegen.

func (Symbol) Equal

func (s Symbol) Equal(t Symbol) bool

func (Symbol) Get

func (s Symbol) Get(data map[Symbol]*StmtGlobal) *StmtGlobal

Get the Global for this symbol.

func (Symbol) Less

func (s Symbol) Less(t Symbol) bool

func (Symbol) String

func (s Symbol) String() string

type Value

type Value interface {
	String() string
	Loc() Location
	Equal(Value) bool
	Less(Value) bool
	BuiltinType() token.Token
	// contains filtered or unexported methods
}

type ValueEmbedEnv

type ValueEmbedEnv struct {
	Location
	Env string
	// Name of its Global.
	Name string // resolved by sema
	// Size of the file content.
	Size uint64 // resolved by sema
}

func (ValueEmbedEnv) BuiltinType

func (v ValueEmbedEnv) BuiltinType() token.Token

func (ValueEmbedEnv) Equal

func (val ValueEmbedEnv) Equal(v Value) bool

func (ValueEmbedEnv) Less

func (val ValueEmbedEnv) Less(v Value) bool

func (ValueEmbedEnv) String

func (val ValueEmbedEnv) String() string

type ValueEmbedFile

type ValueEmbedFile struct {
	Location
	File string
	// Name of its Global.
	Name string // resolved by sema
	// Size of the file content.
	Size uint64 // resolved by sema
}

func (ValueEmbedFile) BuiltinType

func (v ValueEmbedFile) BuiltinType() token.Token

func (ValueEmbedFile) Equal

func (val ValueEmbedFile) Equal(v Value) bool

func (ValueEmbedFile) Less

func (val ValueEmbedFile) Less(v Value) bool

func (ValueEmbedFile) String

func (val ValueEmbedFile) String() string

type ValueFormat

type ValueFormat uint8
const (
	Decimal     ValueFormat = iota // 123
	Hexadecimal                    // 0x
	Binary                         // 0b
	Character                      // ' '
)

func (ValueFormat) Format

func (f ValueFormat) Format(v uint64, typ token.Token) string

type ValueFromGlobal

type ValueFromGlobal struct {
	Location
	Symbol Symbol
	// Type is the global type or its element type if an array.
	Type token.Token // set by sema
}

@arr

func (ValueFromGlobal) BuiltinType

func (v ValueFromGlobal) BuiltinType() token.Token

func (ValueFromGlobal) Equal

func (val ValueFromGlobal) Equal(v Value) bool

func (ValueFromGlobal) Less

func (val ValueFromGlobal) Less(v Value) bool

func (ValueFromGlobal) String

func (val ValueFromGlobal) String() string

type ValueFromGlobalArrayByIndex

type ValueFromGlobalArrayByIndex struct {
	Location
	Symbol Symbol
	Type   token.Token // set by sema
	Index  uint64
}

@arr[0]

func (ValueFromGlobalArrayByIndex) BuiltinType

func (v ValueFromGlobalArrayByIndex) BuiltinType() token.Token

func (ValueFromGlobalArrayByIndex) Equal

func (val ValueFromGlobalArrayByIndex) Equal(v Value) bool

func (ValueFromGlobalArrayByIndex) Less

func (ValueFromGlobalArrayByIndex) String

func (val ValueFromGlobalArrayByIndex) String() string

type ValueFromGlobalArrayByIndexLen

type ValueFromGlobalArrayByIndexLen struct {
	Location
	Symbol Symbol
	Index  uint64
}

@arr[0].len

func (ValueFromGlobalArrayByIndexLen) BuiltinType

func (v ValueFromGlobalArrayByIndexLen) BuiltinType() token.Token

func (ValueFromGlobalArrayByIndexLen) Equal

func (ValueFromGlobalArrayByIndexLen) Less

func (ValueFromGlobalArrayByIndexLen) String

type ValueFromGlobalArrayByVar

type ValueFromGlobalArrayByVar struct {
	Location
	Symbol Symbol
	Type   token.Token // set by sema
	Var    token.Token
}

@arr[r0]

func (ValueFromGlobalArrayByVar) BuiltinType

func (v ValueFromGlobalArrayByVar) BuiltinType() token.Token

func (ValueFromGlobalArrayByVar) Equal

func (val ValueFromGlobalArrayByVar) Equal(v Value) bool

func (ValueFromGlobalArrayByVar) Less

func (val ValueFromGlobalArrayByVar) Less(v Value) bool

func (ValueFromGlobalArrayByVar) String

func (val ValueFromGlobalArrayByVar) String() string

type ValueFromGlobalArrayByVarLen

type ValueFromGlobalArrayByVarLen struct {
	Location
	Symbol Symbol
	Var    token.Token
}

@arr[r0].len

func (ValueFromGlobalArrayByVarLen) BuiltinType

func (v ValueFromGlobalArrayByVarLen) BuiltinType() token.Token

func (ValueFromGlobalArrayByVarLen) Equal

func (ValueFromGlobalArrayByVarLen) Less

func (ValueFromGlobalArrayByVarLen) String

func (val ValueFromGlobalArrayByVarLen) String() string

type ValueLen

type ValueLen struct {
	Location
	Symbol Symbol
	Len    uint64 // set by sema
}

@arr.len

func (ValueLen) BuiltinType

func (v ValueLen) BuiltinType() token.Token

func (ValueLen) Equal

func (val ValueLen) Equal(v Value) bool

func (ValueLen) Less

func (val ValueLen) Less(v Value) bool

func (ValueLen) String

func (val ValueLen) String() string

type ValueLoad

type ValueLoad struct {
	Location
	Type    token.Token
	Address Value // ValueVar, ValueUnsigned, ValueFromGlobal
	Scale   struct {
		Var token.Token
		Mul uint64
	}
	Displacement int64
}

*r0 u8

func (ValueLoad) BuiltinType

func (v ValueLoad) BuiltinType() token.Token

func (ValueLoad) Equal

func (val ValueLoad) Equal(v Value) bool

func (ValueLoad) Less

func (val ValueLoad) Less(v Value) bool

func (ValueLoad) String

func (val ValueLoad) String() string

type ValueSigned

type ValueSigned struct {
	Location
	Format ValueFormat
	Type   token.Token
	Value  int64
}

func (ValueSigned) BuiltinType

func (v ValueSigned) BuiltinType() token.Token

func (ValueSigned) Equal

func (val ValueSigned) Equal(v Value) bool

func (ValueSigned) Less

func (val ValueSigned) Less(v Value) bool

func (ValueSigned) String

func (val ValueSigned) String() string

type ValueSignedArray

type ValueSignedArray struct {
	Location
	Type    token.Token
	Length  uint64
	Default int64
	Values  []int64
}

func (ValueSignedArray) BuiltinType

func (v ValueSignedArray) BuiltinType() token.Token

func (ValueSignedArray) Equal

func (val ValueSignedArray) Equal(v Value) bool

func (ValueSignedArray) Less

func (val ValueSignedArray) Less(v Value) bool

func (ValueSignedArray) String

func (val ValueSignedArray) String() string

type ValueSize

type ValueSize struct {
	Location
	Symbol Symbol
	Size   uint64 // set by sema
}

@arr.size

func (ValueSize) BuiltinType

func (v ValueSize) BuiltinType() token.Token

func (ValueSize) Equal

func (val ValueSize) Equal(v Value) bool

func (ValueSize) Less

func (val ValueSize) Less(v Value) bool

func (ValueSize) String

func (val ValueSize) String() string

type ValueStore

type ValueStore struct {
	Location
	Type    token.Token
	Address Value // ValueVar, ValueUnsigned, ValueFromGlobal
	Scale   struct {
		Var token.Token
		Mul uint64
	}
	Displacement uint64
}

*r0 u8 =

func (ValueStore) BuiltinType

func (v ValueStore) BuiltinType() token.Token

func (ValueStore) Equal

func (val ValueStore) Equal(v Value) bool

func (ValueStore) Less

func (val ValueStore) Less(v Value) bool

func (ValueStore) String

func (val ValueStore) String() string

type ValueString

type ValueString struct {
	Location
	Value string
}

func (ValueString) BuiltinType

func (v ValueString) BuiltinType() token.Token

func (ValueString) Equal

func (val ValueString) Equal(v Value) bool

func (ValueString) Less

func (val ValueString) Less(v Value) bool

func (ValueString) String

func (val ValueString) String() string

type ValueStringArray

type ValueStringArray struct {
	Location
	Length  uint64
	Default string
	Values  []Value // ValueString, ValueFromGlobal after string interning
}

func (ValueStringArray) BuiltinType

func (v ValueStringArray) BuiltinType() token.Token

func (ValueStringArray) Equal

func (val ValueStringArray) Equal(v Value) bool

func (ValueStringArray) Less

func (val ValueStringArray) Less(v Value) bool

func (ValueStringArray) String

func (val ValueStringArray) String() string

type ValueUnsigned

type ValueUnsigned struct {
	Location
	Format ValueFormat
	Type   token.Token
	Value  uint64
}

func (ValueUnsigned) BuiltinType

func (v ValueUnsigned) BuiltinType() token.Token

func (ValueUnsigned) Equal

func (val ValueUnsigned) Equal(v Value) bool

func (ValueUnsigned) Less

func (val ValueUnsigned) Less(v Value) bool

func (ValueUnsigned) String

func (val ValueUnsigned) String() string

type ValueUnsignedArray

type ValueUnsignedArray struct {
	Location
	Type    token.Token
	Format  ValueFormat
	Length  uint64
	Default uint64
	Values  []uint64
}

func (ValueUnsignedArray) BuiltinType

func (v ValueUnsignedArray) BuiltinType() token.Token

func (ValueUnsignedArray) Equal

func (val ValueUnsignedArray) Equal(v Value) bool

func (ValueUnsignedArray) Less

func (val ValueUnsignedArray) Less(v Value) bool

func (ValueUnsignedArray) String

func (val ValueUnsignedArray) String() string

type ValueVar

type ValueVar struct {
	Location
	Prefix token.Token
	Type   token.Token
	Var    token.Token
}

func (ValueVar) BuiltinType

func (v ValueVar) BuiltinType() token.Token

func (ValueVar) Equal

func (val ValueVar) Equal(v Value) bool

func (ValueVar) Less

func (val ValueVar) Less(v Value) bool

func (ValueVar) String

func (val ValueVar) String() string

type ValueVarByIndex

type ValueVarByIndex struct {
	Location
	Var   token.Token
	Index uint64
}

WIP r0[0]

func (ValueVarByIndex) BuiltinType

func (v ValueVarByIndex) BuiltinType() token.Token

func (ValueVarByIndex) Equal

func (val ValueVarByIndex) Equal(v Value) bool

func (ValueVarByIndex) Less

func (val ValueVarByIndex) Less(v Value) bool

func (ValueVarByIndex) String

func (val ValueVarByIndex) String() string

type ValueVarByVar

type ValueVarByVar struct {
	Location
	Var      token.Token
	VarIndex token.Token
}

WIP r0[r1]

func (ValueVarByVar) BuiltinType

func (v ValueVarByVar) BuiltinType() token.Token

func (ValueVarByVar) Equal

func (val ValueVarByVar) Equal(v Value) bool

func (ValueVarByVar) Less

func (val ValueVarByVar) Less(v Value) bool

func (ValueVarByVar) String

func (val ValueVarByVar) String() string

type ValueVarLen

type ValueVarLen struct {
	Location
	Var token.Token
}

ValueVarLen gives the length of the array or string stored in Var. e.g. r0.len

func (ValueVarLen) BuiltinType

func (v ValueVarLen) BuiltinType() token.Token

func (ValueVarLen) Equal

func (val ValueVarLen) Equal(v Value) bool

func (ValueVarLen) Less

func (val ValueVarLen) Less(v Value) bool

func (ValueVarLen) String

func (val ValueVarLen) String() string

type ValueVarSize

type ValueVarSize struct {
	Location
	Var token.Token
}

ValueVarSize gives the size of the array or string elements stored in Var. e.g. r0.size

func (ValueVarSize) BuiltinType

func (v ValueVarSize) BuiltinType() token.Token

func (ValueVarSize) Equal

func (val ValueVarSize) Equal(v Value) bool

func (ValueVarSize) Less

func (val ValueVarSize) Less(v Value) bool

func (ValueVarSize) String

func (val ValueVarSize) String() string

Jump to

Keyboard shortcuts

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