Documentation ¶
Index ¶
- Constants
- type Encoding
- type Instr
- type InstrKind
- type InstrPusher
- func (p *InstrPusher) Add()
- func (p *InstrPusher) Add1()
- func (p *InstrPusher) Aref()
- func (p *InstrPusher) Aset()
- func (p *InstrPusher) Call(argc int, name string)
- func (p *InstrPusher) Car()
- func (p *InstrPusher) Cdr()
- func (p *InstrPusher) Concat(argc int)
- func (p *InstrPusher) Cons()
- func (p *InstrPusher) ConstRef(cvIndex int)
- func (p *InstrPusher) Discard(n int)
- func (p *InstrPusher) Empty()
- func (p *InstrPusher) Eq()
- func (p *InstrPusher) Equal()
- func (p *InstrPusher) Integerp()
- func (p *InstrPusher) Jmp(label Instr)
- func (p *InstrPusher) JmpNil(label Instr)
- func (p *InstrPusher) JmpNilElsePop(label Instr)
- func (p *InstrPusher) JmpNotNil(label Instr)
- func (p *InstrPusher) JmpNotNilElsePop(label Instr)
- func (p *InstrPusher) Label(label Instr)
- func (p *InstrPusher) Length()
- func (p *InstrPusher) List(n int)
- func (p *InstrPusher) Member()
- func (p *InstrPusher) Memq()
- func (p *InstrPusher) Min()
- func (p *InstrPusher) Mul()
- func (p *InstrPusher) Neg()
- func (p *InstrPusher) Not()
- func (p *InstrPusher) NumEq()
- func (p *InstrPusher) NumGt()
- func (p *InstrPusher) NumGte()
- func (p *InstrPusher) NumLt()
- func (p *InstrPusher) NumLte()
- func (p *InstrPusher) PushInstr(ins Instr)
- func (p *InstrPusher) Quo()
- func (p *InstrPusher) Return()
- func (p *InstrPusher) SetCar()
- func (p *InstrPusher) SetCdr()
- func (p *InstrPusher) StackRef(stIndex int)
- func (p *InstrPusher) StackSet(stIndex int)
- func (p *InstrPusher) StrEq()
- func (p *InstrPusher) StrLt()
- func (p *InstrPusher) Stringp()
- func (p *InstrPusher) Sub()
- func (p *InstrPusher) Sub1()
- func (p *InstrPusher) Substring()
- func (p *InstrPusher) Symbolp()
- func (p *InstrPusher) VarRef(cvIndex int)
- func (p *InstrPusher) VarSet(cvIndex int)
- func (p *InstrPusher) Xbind(name string)
- func (p *InstrPusher) Xgoto(label Instr)
- func (p *InstrPusher) XlambdaEnter()
- func (p *InstrPusher) XlambdaRet(label Instr)
- func (p *InstrPusher) XlocalRef(name string)
- func (p *InstrPusher) XlocalSet(name string)
- func (p *InstrPusher) XscopeEnter()
- func (p *InstrPusher) XscopeLeave()
- func (p *InstrPusher) XvarRef(name string)
- func (p *InstrPusher) XvarSet(name string)
- type Unit
Constants ¶
View Source
const ( AttrTakeNothing inputMode = iota AttrTake1 AttrTake2 AttrTake3 AttrTakeN AttrTakeNplus1 AttrReplaceNth )
View Source
const ( AttrPushNothing outputMode = iota AttrDupNth AttrPushTmp AttrPushConst AttrPushAndDiscard )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoding ¶
func EncodingOf ¶
type Instr ¶
type Instr struct { Kind InstrKind // Determines the instruction kind Data int32 // Instruction direct argument (optional) Meta string // Additional instruction data (optional) Prev *Instr // Previous instruction Next *Instr // Next instruction }
Instr is a single IR instruction.
func (*Instr) InsertLeft ¶
InsertLeft calls InsertPrev consequentially for each passed instruction. E.g.: [prev ins next].InsertLeft([a b]) => [prev a b ins next].
func (*Instr) InsertNext ¶
InsertNext adds instruction after current position.
func (*Instr) InsertPrev ¶
InsertPrev adds instruction before current position.
func (*Instr) InsertRight ¶
InsertRight calls InsertNext consequentially for each passed instruction. E.g.: [prev ins next].InsertRight([a b]) => [prev ins a b next].
type InstrKind ¶
type InstrKind int32
const ( Empty InstrKind = iota XvarRef XvarSet XlocalRef XlocalSet Xbind XscopeEnter XscopeLeave Xgoto XlambdaEnter XlambdaRetLabel XlambdaRet Label Jmp // "goto" JmpNil // "gotoifnil" JmpNotNil // "gotoifnonnil" JmpNilElsePop // "gotoifnilelsepop" JmpNotNilElsePop // "gotoifnonnilelsepop" Return Call Eq Equal Substring // "substring" Length NumEq // "eqlsign" NumLt // "lss" NumGt // "gtr" NumLte // "leq" NumGte // "geq" Add // "plus" Sub // "diff" Mul // "mult" Quo Add1 Sub1 Min Neg // "negate" StrEq // "stringeqlsign" StrLt // "stringlss" Concat Aref Aset Car Cdr SetCar SetCdr Cons List Memq Member Stringp Integerp Symbolp Not ConstRef StackRef StackSet Discard VarRef VarSet )
type InstrPusher ¶
type InstrPusher Unit
func (*InstrPusher) Add ¶
func (p *InstrPusher) Add()
func (*InstrPusher) Add1 ¶
func (p *InstrPusher) Add1()
func (*InstrPusher) Aref ¶
func (p *InstrPusher) Aref()
func (*InstrPusher) Aset ¶
func (p *InstrPusher) Aset()
func (*InstrPusher) Call ¶
func (p *InstrPusher) Call(argc int, name string)
func (*InstrPusher) Car ¶
func (p *InstrPusher) Car()
func (*InstrPusher) Cdr ¶
func (p *InstrPusher) Cdr()
func (*InstrPusher) Concat ¶
func (p *InstrPusher) Concat(argc int)
func (*InstrPusher) Cons ¶
func (p *InstrPusher) Cons()
func (*InstrPusher) ConstRef ¶
func (p *InstrPusher) ConstRef(cvIndex int)
func (*InstrPusher) Discard ¶
func (p *InstrPusher) Discard(n int)
func (*InstrPusher) Empty ¶
func (p *InstrPusher) Empty()
func (*InstrPusher) Eq ¶
func (p *InstrPusher) Eq()
func (*InstrPusher) Equal ¶
func (p *InstrPusher) Equal()
func (*InstrPusher) Integerp ¶
func (p *InstrPusher) Integerp()
func (*InstrPusher) Jmp ¶
func (p *InstrPusher) Jmp(label Instr)
func (*InstrPusher) JmpNil ¶
func (p *InstrPusher) JmpNil(label Instr)
func (*InstrPusher) JmpNilElsePop ¶
func (p *InstrPusher) JmpNilElsePop(label Instr)
func (*InstrPusher) JmpNotNil ¶
func (p *InstrPusher) JmpNotNil(label Instr)
func (*InstrPusher) JmpNotNilElsePop ¶
func (p *InstrPusher) JmpNotNilElsePop(label Instr)
func (*InstrPusher) Label ¶
func (p *InstrPusher) Label(label Instr)
func (*InstrPusher) Length ¶
func (p *InstrPusher) Length()
func (*InstrPusher) List ¶
func (p *InstrPusher) List(n int)
func (*InstrPusher) Member ¶
func (p *InstrPusher) Member()
func (*InstrPusher) Memq ¶
func (p *InstrPusher) Memq()
func (*InstrPusher) Min ¶
func (p *InstrPusher) Min()
func (*InstrPusher) Mul ¶
func (p *InstrPusher) Mul()
func (*InstrPusher) Neg ¶
func (p *InstrPusher) Neg()
func (*InstrPusher) Not ¶
func (p *InstrPusher) Not()
func (*InstrPusher) NumEq ¶
func (p *InstrPusher) NumEq()
func (*InstrPusher) NumGt ¶
func (p *InstrPusher) NumGt()
func (*InstrPusher) NumGte ¶
func (p *InstrPusher) NumGte()
func (*InstrPusher) NumLt ¶
func (p *InstrPusher) NumLt()
func (*InstrPusher) NumLte ¶
func (p *InstrPusher) NumLte()
func (*InstrPusher) PushInstr ¶
func (p *InstrPusher) PushInstr(ins Instr)
func (*InstrPusher) Quo ¶
func (p *InstrPusher) Quo()
func (*InstrPusher) Return ¶
func (p *InstrPusher) Return()
func (*InstrPusher) SetCar ¶
func (p *InstrPusher) SetCar()
func (*InstrPusher) SetCdr ¶
func (p *InstrPusher) SetCdr()
func (*InstrPusher) StackRef ¶
func (p *InstrPusher) StackRef(stIndex int)
func (*InstrPusher) StackSet ¶
func (p *InstrPusher) StackSet(stIndex int)
func (*InstrPusher) StrEq ¶
func (p *InstrPusher) StrEq()
func (*InstrPusher) StrLt ¶
func (p *InstrPusher) StrLt()
func (*InstrPusher) Stringp ¶
func (p *InstrPusher) Stringp()
func (*InstrPusher) Sub ¶
func (p *InstrPusher) Sub()
func (*InstrPusher) Sub1 ¶
func (p *InstrPusher) Sub1()
func (*InstrPusher) Substring ¶
func (p *InstrPusher) Substring()
func (*InstrPusher) Symbolp ¶
func (p *InstrPusher) Symbolp()
func (*InstrPusher) VarRef ¶
func (p *InstrPusher) VarRef(cvIndex int)
func (*InstrPusher) VarSet ¶
func (p *InstrPusher) VarSet(cvIndex int)
func (*InstrPusher) Xbind ¶
func (p *InstrPusher) Xbind(name string)
func (*InstrPusher) Xgoto ¶
func (p *InstrPusher) Xgoto(label Instr)
func (*InstrPusher) XlambdaEnter ¶
func (p *InstrPusher) XlambdaEnter()
func (*InstrPusher) XlambdaRet ¶
func (p *InstrPusher) XlambdaRet(label Instr)
func (*InstrPusher) XlocalRef ¶
func (p *InstrPusher) XlocalRef(name string)
func (*InstrPusher) XlocalSet ¶
func (p *InstrPusher) XlocalSet(name string)
func (*InstrPusher) XscopeEnter ¶
func (p *InstrPusher) XscopeEnter()
func (*InstrPusher) XscopeLeave ¶
func (p *InstrPusher) XscopeLeave()
func (*InstrPusher) XvarRef ¶
func (p *InstrPusher) XvarRef(name string)
func (*InstrPusher) XvarSet ¶
func (p *InstrPusher) XvarSet(name string)
type Unit ¶
type Unit struct {
// contains filtered or unexported fields
}
func (*Unit) InstrPusher ¶
func (u *Unit) InstrPusher() *InstrPusher
func (*Unit) NewLambdaRetLabel ¶
func (*Unit) NewUserLabel ¶
Click to show internal directories.
Click to hide internal directories.