dt

package
v0.0.0-...-9dcd13a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstPool

type ConstPool struct {
	// contains filtered or unexported fields
}

ConstPool is a set of distincs constant values. It stores atoms of int, float, string and symbol types.

Serves as a builder for Emacs function constant vector.

func (*ConstPool) Bytes

func (cp *ConstPool) Bytes() []byte

Bytes returns printed representation of Emacs Lisp constant vector.

func (*ConstPool) Clear

func (cp *ConstPool) Clear()

Clear removes all stored elements. Storage is reused.

func (*ConstPool) Get

func (cp *ConstPool) Get(index uint16) interface{}

Get extracts constant vector value stored at specified index.

func (*ConstPool) GetFloat

func (cp *ConstPool) GetFloat(index uint16) float64

GetFloat is like Get, but result is type asserted to float64.

func (*ConstPool) GetInt

func (cp *ConstPool) GetInt(index uint16) int64

GetInt is like Get, but result is type asserted to int64.

func (*ConstPool) GetString

func (cp *ConstPool) GetString(index uint16) string

GetString is like Get, but result is type asserted to string.

func (*ConstPool) GetSym

func (cp *ConstPool) GetSym(index int) lisp.Symbol

GetSym is like Get, but result is type asserted to lisp.Symbol.

func (*ConstPool) InsertFloat

func (cp *ConstPool) InsertFloat(x float64) int

InsertFloat inserts given argument if it is not already present. Returns constant vector index.

func (*ConstPool) InsertInt

func (cp *ConstPool) InsertInt(x int64) int

InsertInt inserts given argument if it is not already present. Returns constant vector index.

func (*ConstPool) InsertString

func (cp *ConstPool) InsertString(x string) int

InsertString inserts given argument if it is not already present. Returns constant vector index.

func (*ConstPool) InsertSym

func (cp *ConstPool) InsertSym(x string) int

InsertSym inserts given argument if it is not already present. Returns constant vector index.

type DataStack

type DataStack struct {
	// contains filtered or unexported fields
}

DataStack emulates Elisp data (parameter) stack. Used to generate stack-ref instructions.

func NewDataStack

func NewDataStack(bindings []string) *DataStack

NewDataStack creates new stack that is populated by provided bindings.

func (*DataStack) Bind

func (st *DataStack) Bind(name string)

Bind assigns name for last pushed value.

func (*DataStack) Discard

func (st *DataStack) Discard(n uint16)

Discard drops last N stack elements.

func (*DataStack) Dup

func (st *DataStack) Dup(ref uint16)

Dup pushes specified stack element (copies it).

func (*DataStack) Len

func (st *DataStack) Len() int

Len returns current stack size.

func (*DataStack) Lookup

func (st *DataStack) Lookup(name string) int

Lookup finds binding and returns its ref index (not normal index).

func (*DataStack) MaxLen

func (st *DataStack) MaxLen() int

MaxLen returns max stack length recorded.

func (*DataStack) Push

func (st *DataStack) Push()

Push adds new unnamed value to stack.

func (*DataStack) PushConst

func (st *DataStack) PushConst(index uint16)

PushConst is like Push, but used for constant refs.

func (*DataStack) Rebind

func (st *DataStack) Rebind(ref int, name string)

Rebind re-assigns name for specified stack element.

func (*DataStack) Replace

func (st *DataStack) Replace(index uint16)

Replace = stack.rebind(index-1, stack.pop()).

func (*DataStack) String

func (st *DataStack) String() string

String returns human-readable stack representation. Useful for debug.

type ScopeStack

type ScopeStack struct {
	// contains filtered or unexported fields
}

func (*ScopeStack) PopScope

func (ss *ScopeStack) PopScope() int

func (*ScopeStack) PushScope

func (ss *ScopeStack) PushScope()

func (*ScopeStack) SetScopeDepth

func (ss *ScopeStack) SetScopeDepth(depth int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL