Documentation ¶
Index ¶
- func EmitConstant(c *Compiler, k Constant, reg Register, line int)
- func EmitMove(c *Compiler, dst Register, src Register, line int)
- func EmitMoveNoLine(c *Compiler, dst Register, src Register)
- type Bool
- type Call
- type ClearReg
- type Code
- type Combine
- type Compiler
- func (c *Compiler) DeclareGotoLabel(name Name) Label
- func (c *Compiler) DeclareLocal(name Name, reg Register)
- func (c *Compiler) Dump()
- func (c *Compiler) Emit(instr Instruction, line int)
- func (c *Compiler) EmitGotoLabel(name Name)
- func (c *Compiler) EmitJump(lblName Name, line int)
- func (c *Compiler) EmitLabel(lbl Label)
- func (c *Compiler) EmitNoLine(instr Instruction)
- func (c *Compiler) GetCode(name string) *Code
- func (c *Compiler) GetConstant(k Constant) uint
- func (c *Compiler) GetFreeRegister() Register
- func (c *Compiler) GetGotoLabel(name Name) (Label, bool)
- func (c *Compiler) GetNewLabel() Label
- func (c *Compiler) GetRegister(name Name) (Register, bool)
- func (c *Compiler) NewChild() *Compiler
- func (c *Compiler) NewConstantCompiler() *ConstantCompiler
- func (c *Compiler) PopContext()
- func (c *Compiler) PushContext()
- func (c *Compiler) ReleaseRegister(reg Register)
- func (c *Compiler) TakeRegister(reg Register)
- func (c *Compiler) Upvalues() []Register
- type Constant
- type ConstantCompiler
- type ConstantPool
- type EtcLookup
- type FillTable
- type Float
- type InstrCompiler
- type Instruction
- type Int
- type Jump
- type JumpIf
- type JumpIfForLoopDone
- type Label
- type LexicalContext
- func (c LexicalContext) AddLabel(name Name, label Label) (ok bool)
- func (c LexicalContext) AddToRoot(name Name, reg Register) (ok bool)
- func (c LexicalContext) AddToTop(name Name, reg Register) (ok bool)
- func (c LexicalContext) Dump()
- func (c LexicalContext) GetLabel(name Name) (label Label, ok bool)
- func (c LexicalContext) GetRegister(name Name, tags uint) (reg Register, ok bool)
- func (c LexicalContext) Pop() (LexicalContext, lexicalMap)
- func (c LexicalContext) PushNew() LexicalContext
- func (c LexicalContext) Top() lexicalMap
- type LoadConst
- type Lookup
- type MkClosure
- type MkCont
- type MkTable
- type Name
- type NilType
- type Push
- type PushCC
- type Receive
- type ReceiveEtc
- type Register
- type SetIndex
- type String
- type Transform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitMoveNoLine ¶
Types ¶
type Call ¶
type Call struct {
Cont Register
}
func (Call) Compile ¶
func (c Call) Compile(kc InstrCompiler)
type ClearReg ¶
type ClearReg struct {
Dst Register
}
func (ClearReg) Compile ¶
func (i ClearReg) Compile(kc InstrCompiler)
type Code ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func NewCompiler ¶
func (*Compiler) DeclareGotoLabel ¶
func (*Compiler) DeclareLocal ¶
func (*Compiler) Emit ¶
func (c *Compiler) Emit(instr Instruction, line int)
func (*Compiler) EmitGotoLabel ¶
func (*Compiler) EmitNoLine ¶
func (c *Compiler) EmitNoLine(instr Instruction)
func (*Compiler) GetConstant ¶
func (*Compiler) GetFreeRegister ¶
func (*Compiler) GetNewLabel ¶
func (*Compiler) NewConstantCompiler ¶
func (c *Compiler) NewConstantCompiler() *ConstantCompiler
func (*Compiler) PopContext ¶
func (c *Compiler) PopContext()
func (*Compiler) PushContext ¶
func (c *Compiler) PushContext()
func (*Compiler) ReleaseRegister ¶
func (*Compiler) TakeRegister ¶
type Constant ¶
type Constant interface {
Compile(*ConstantCompiler) code.Constant
}
type ConstantCompiler ¶
func (*ConstantCompiler) CompileQueue ¶
func (kc *ConstantCompiler) CompileQueue() *code.Unit
func (*ConstantCompiler) GetConstant ¶
func (kc *ConstantCompiler) GetConstant(ki uint) Constant
func (*ConstantCompiler) QueueConstant ¶
func (kc *ConstantCompiler) QueueConstant(ki uint) int
type ConstantPool ¶
type ConstantPool struct {
// contains filtered or unexported fields
}
func (*ConstantPool) Constants ¶
func (c *ConstantPool) Constants() []Constant
func (*ConstantPool) GetConstant ¶
func (c *ConstantPool) GetConstant(k Constant) uint
type InstrCompiler ¶
type InstrCompiler struct { *ConstantCompiler // contains filtered or unexported fields }
func (InstrCompiler) Emit ¶
func (ic InstrCompiler) Emit(opcode code.Opcode)
type Instruction ¶
type Instruction interface { fmt.Stringer Compile(InstrCompiler) }
type Jump ¶
type Jump struct {
Label Label
}
func (Jump) Compile ¶
func (j Jump) Compile(kc InstrCompiler)
type JumpIfForLoopDone ¶
func (JumpIfForLoopDone) Compile ¶
func (j JumpIfForLoopDone) Compile(kc InstrCompiler)
func (JumpIfForLoopDone) String ¶
func (j JumpIfForLoopDone) String() string
type LexicalContext ¶
type LexicalContext []lexicalMap
func (LexicalContext) AddToRoot ¶
func (c LexicalContext) AddToRoot(name Name, reg Register) (ok bool)
func (LexicalContext) AddToTop ¶
func (c LexicalContext) AddToTop(name Name, reg Register) (ok bool)
func (LexicalContext) Dump ¶
func (c LexicalContext) Dump()
func (LexicalContext) GetRegister ¶
func (c LexicalContext) GetRegister(name Name, tags uint) (reg Register, ok bool)
func (LexicalContext) Pop ¶
func (c LexicalContext) Pop() (LexicalContext, lexicalMap)
func (LexicalContext) PushNew ¶
func (c LexicalContext) PushNew() LexicalContext
func (LexicalContext) Top ¶
func (c LexicalContext) Top() lexicalMap
type MkTable ¶
type MkTable struct {
Dst Register
}
func (MkTable) Compile ¶
func (m MkTable) Compile(kc InstrCompiler)
type PushCC ¶
type PushCC struct {
Cont Register
}
func (PushCC) Compile ¶
func (p PushCC) Compile(kc InstrCompiler)
type Receive ¶
type Receive struct {
Dst []Register
}
func (Receive) Compile ¶
func (r Receive) Compile(kc InstrCompiler)
type ReceiveEtc ¶
func (ReceiveEtc) Compile ¶
func (r ReceiveEtc) Compile(kc InstrCompiler)
func (ReceiveEtc) String ¶
func (r ReceiveEtc) String() string
Click to show internal directories.
Click to hide internal directories.