Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ErrNoLocalScope is raised when no local scope has been created ErrNoLocalScope = "no local scopes have been pushed" // ErrDuplicateName is raised when an attempt is made to register a // duplicated name within the same local scope ErrDuplicateName = "name duplicated in scope: %s" )
View Source
const ErrLabelAlreadyAnchored = "label has already been anchored"
ErrLabelAlreadyAnchored is raised when the finalizer identifies that a label has been anchored more than once in the Instructions stream
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoded ¶
type Encoded struct { Code isa.Instructions Globals env.Namespace Constants data.Vector Closure data.Locals }
Encoded is a snapshot of the current Encoder's state. It is used as an intermediate step in the compilation process, particularly as input to the optimizer.
type Encoder ¶
type Encoder interface { Child() Encoder Emit(isa.Opcode, ...isa.Operand) Encode() *Encoded Globals() env.Namespace NewLabel() isa.Operand AddConstant(data.Value) isa.Operand PushParams(data.Locals, bool) PopParams() PushLocals() PopLocals() AddLocal(data.Local, CellType) *IndexedCell ResolveScoped(data.Local) (*ScopedCell, bool) ResolveClosure(data.Local) (*IndexedCell, bool) ResolveParam(data.Local) (*IndexedCell, bool) ResolveLocal(data.Local) (*IndexedCell, bool) }
Encoder exposes an interface for stateful compiler encoding
func NewEncoder ¶
NewEncoder instantiates a new Encoder
type IndexedCell ¶
IndexedCell attaches an Index to a Cell
type IndexedCells ¶
type IndexedCells []*IndexedCell
IndexedCells encapsulates a group of IndexedCells
Click to show internal directories.
Click to hide internal directories.