Documentation ¶
Index ¶
- type Callable
- type Cmd
- type Context
- func (c *Context) Arg(i uint8) Value
- func (c *Context) Args() []Value
- func (c *Context) GetCmd() (cmd Cmd)
- func (c *Context) GrowVals(n uint32)
- func (c *Context) IsNative() bool
- func (c *Context) NewNativeCall(label string, args ...Value) (nc *Context)
- func (c *Context) Parent() *Context
- func (c *Context) Pop() (v Value)
- func (c *Context) PopArr(v []Value) []Value
- func (c *Context) PopN(n uint32) (v []Value)
- func (c *Context) Push(v ...Value)
- func (c *Context) Read(buf []byte) (n int, err error)
- func (c *Context) SetVal(i int32, v Value)
- func (c *Context) Strlst() string
- func (c *Context) Val(i int32) *Value
- func (c *Context) Vals() []Value
- type Cpu
- type ExitErr
- type LookupErr
- type NativeCall
- type Pointer
- type Registry
- type StructField
- type StructType
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd = uint8
const ( // Do nothing SKIP Cmd = iota // return an `*ExitErr` EXIT // register opers // copy value of a register to another one MOV // set the register value SETB // load variable value to register LOADB // store register value to variable STOREB SETW LOADW STOREW SETI LOADI STOREI SETQ LOADQ STOREQ // TODO: Memory alloc opers NEW MAKE_SLICE MAKE_MAP MAKE_CHAN LOADP STOREP // String opers SETS LOADS STORES // Stack opers PUSHU PUSHB PUSHW PUSHI PUSHQ PUSHP PUSHS POP POPU POPP POPS B2Q W2Q I2Q I2F I2D UI2F UI2D Q2F Q2D UQ2F UQ2D F2I F2UI F2Q F2UQ F2D D2I D2UI D2Q D2UQ D2F // integer opers ADD SUB MUL SMUL QUO SQUO REM SREM // bit opers NOT AND OR XOR SHL SHR SSHR SSHRW SSHRI SSHRQ // increse and decrese INC DEC // float opers FNEG FADD FSUB FMUL FQUO DNEG DADD DSUB DMUL DQUO // Boolean opers and compare LNOT LAND LOR EQ NE GT LT CMP ICMP FCMP DCMP // String opers CAT CUT B2S S2B // program pointer control GOTO JMP JMP_IF JMP_IFN // function things CALL CALLN CALLG CALLD ARG RET // panic and recover PAN REC // opers of `chan` SEND RECV RECVB )
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) NewNativeCall ¶
type Cpu ¶
type NativeCall ¶
type Registry ¶
type Registry interface { Lookup(label string) (meta LabelMeta, ok bool) GetNative(label string) NativeCall }
type StructField ¶
type StructType ¶
type StructType struct { Fields []StructField Methods []string }
type Value ¶
type Value interface { Bool() bool Int8() int8 Int16() int16 Int32() int32 Int64() int64 Uint8() uint8 Uint16() uint16 Uint32() uint32 Uint64() uint64 Float32() float32 Float64() float64 Pointer() Pointer String() string Len() int64 Cap() int64 Index(n int64) Value SetIndex(n int64, val Value) Keys() []Value Values() []Value Items() [][2]Value Key(k Value) Value HasKey(k Value) bool SetKey(k Value, val Value) }
var Nil Value = nilItem{}
Click to show internal directories.
Click to hide internal directories.