Documentation ¶
Index ¶
Constants ¶
View Source
const ( AttrTakeNothing inputMode = iota AttrTake1 AttrTake2 AttrTake3 AttrTakeN AttrTakeNplus1 AttrReplaceNth )
View Source
const ( AttrPushNothing outputMode = iota AttrDupNth AttrPushTmp AttrPushConst AttrPushAndDiscard )
View Source
const ( AttrEnc0 encoding = iota AttrEnc1 )
Variables ¶
View Source
var ( Jmp = []byte("goto") JmpNil = []byte("goto-if-nil") JmpNotNil = []byte("goto-if-not-nil") JmpNilElsePop = []byte("goto-if-nil-else-pop") JmpNotNilElsePop = []byte("goto-if-not-nil-else-pop") Label = []byte("label") )
Jump instruction names.
View Source
var ( Eq = binOp("eq") Equal = binOp("equal") NumEq = binOp("num=") NumGt = binOp("num>") NumLt = binOp("num<") NumLte = binOp("num<=") NumGte = binOp("num>=") NumSub = binOp("sub") NumAdd = binOp("add") NumMul = binOp("mul") NumQuo = binOp("quo") NumMin = binOp("min") StrEq = binOp("str=") StrLt = binOp("str<") ArrayRef = binOp("array-ref") Cons = binOp("cons") Memq = binOp("memq") Member = binOp("member") Concat2 = Concat(2) )
Binary ops.
View Source
var ( IsStr = unaryOp("str?") IsInt = unaryOp("int?") IsSymbol = unaryOp("symbol?") Add1 = unaryOp("add1") Sub1 = unaryOp("sub1") Not = unaryOp("not") Neg = unaryOp("neg") Car = unaryOp("car") Cdr = unaryOp("cdr") Length = unaryOp("length") )
Unary ops.
View Source
var ( ArraySet = Instr{ Name: []byte("array-set"), Encoding: AttrEnc0, Input: AttrTake3, Output: AttrPushAndDiscard, } Return = Instr{ Name: []byte("return"), Encoding: AttrEnc0, Input: AttrTake1, } Substr = Instr{ Name: []byte("substr"), Encoding: AttrEnc0, Input: AttrTake3, Output: AttrPushTmp, } SetCar = Instr{ Name: []byte("setcar"), Encoding: AttrEnc0, Input: AttrTake2, Output: AttrPushAndDiscard, } SetCdr = Instr{ Name: []byte("setcdr"), Encoding: AttrEnc0, Input: AttrTake2, Output: AttrPushAndDiscard, } )
Other ops without explicit parameter.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.