Documentation ¶
Overview ¶
*
- Data structures for the representation of Venice values by the virtual machine.
Index ¶
- Variables
- func ReadCompiledProgramFromFile(filePath string) (*bytecode.CompiledProgram, error)
- func ReadCompiledProgramFromString(programString string) (*bytecode.CompiledProgram, error)
- func WriteCompiledProgramToFile(writer *bufio.Writer, compiledProgram *bytecode.CompiledProgram)
- type BytecodeParseError
- type Environment
- type InternalError
- type PanicError
- type VeniceBoolean
- type VeniceBoundMethodObject
- type VeniceClassObject
- type VeniceEnumObject
- type VeniceFunctionObject
- type VeniceInteger
- type VeniceIterator
- type VeniceList
- type VeniceListIterator
- type VeniceMap
- func (v *VeniceMap) Clear()
- func (v *VeniceMap) Compare(otherAny VeniceValue) bool
- func (v *VeniceMap) Copy() *VeniceMap
- func (v *VeniceMap) Entries() *VeniceList
- func (v *VeniceMap) Equals(otherAny VeniceValue) bool
- func (v *VeniceMap) Get(key VeniceValue) VeniceValue
- func (v *VeniceMap) Hash(h maphash.Hash) uint64
- func (v *VeniceMap) Keys() *VeniceList
- func (v *VeniceMap) Put(key VeniceValue, value VeniceValue)
- func (v *VeniceMap) Remove(key VeniceValue)
- func (v *VeniceMap) String() string
- func (v *VeniceMap) Values() *VeniceList
- type VeniceMapChain
- type VeniceMapIterator
- type VeniceRealNumber
- type VeniceString
- type VeniceStringIterator
- type VeniceTuple
- type VeniceValue
- type VirtualMachine
Constants ¶
This section is empty.
Variables ¶
View Source
var VENICE_OPTIONAL_NONE = &VeniceEnumObject{Label: "None", Values: nil}
Functions ¶
func ReadCompiledProgramFromFile ¶
func ReadCompiledProgramFromFile(filePath string) (*bytecode.CompiledProgram, error)
func ReadCompiledProgramFromString ¶
func ReadCompiledProgramFromString(programString string) (*bytecode.CompiledProgram, error)
func WriteCompiledProgramToFile ¶
func WriteCompiledProgramToFile(writer *bufio.Writer, compiledProgram *bytecode.CompiledProgram)
Types ¶
type BytecodeParseError ¶
func (*BytecodeParseError) Error ¶
func (e *BytecodeParseError) Error() string
type Environment ¶
type Environment struct { Parent *Environment Symbols map[string]VeniceValue }
func (*Environment) Get ¶
func (env *Environment) Get(symbol string) (VeniceValue, bool)
func (*Environment) Put ¶
func (env *Environment) Put(symbol string, value VeniceValue)
type InternalError ¶
type InternalError struct {
Message string
}
func (*InternalError) Error ¶
func (e *InternalError) Error() string
type PanicError ¶
type PanicError struct {
Message string
}
func (*PanicError) Error ¶
func (e *PanicError) Error() string
type VeniceBoolean ¶
type VeniceBoolean struct {
Value bool
}
func (*VeniceBoolean) Compare ¶
func (v *VeniceBoolean) Compare(otherAny VeniceValue) bool
func (*VeniceBoolean) Equals ¶
func (v *VeniceBoolean) Equals(otherAny VeniceValue) bool
func (*VeniceBoolean) String ¶
func (v *VeniceBoolean) String() string
type VeniceBoundMethodObject ¶
type VeniceBoundMethodObject struct { Function *VeniceFunctionObject Object VeniceValue }
func (*VeniceBoundMethodObject) Compare ¶
func (v *VeniceBoundMethodObject) Compare(otherAny VeniceValue) bool
func (*VeniceBoundMethodObject) Equals ¶
func (v *VeniceBoundMethodObject) Equals(otherAny VeniceValue) bool
func (*VeniceBoundMethodObject) Hash ¶
func (v *VeniceBoundMethodObject) Hash(h maphash.Hash) uint64
func (*VeniceBoundMethodObject) String ¶
func (v *VeniceBoundMethodObject) String() string
type VeniceClassObject ¶
type VeniceClassObject struct { ClassName string Values []VeniceValue }
func (*VeniceClassObject) Compare ¶
func (v *VeniceClassObject) Compare(otherAny VeniceValue) bool
func (*VeniceClassObject) Equals ¶
func (v *VeniceClassObject) Equals(otherAny VeniceValue) bool
func (*VeniceClassObject) String ¶
func (v *VeniceClassObject) String() string
type VeniceEnumObject ¶
type VeniceEnumObject struct { Label string Values []VeniceValue }
func VeniceOptionalOf ¶
func VeniceOptionalOf(value VeniceValue) *VeniceEnumObject
func (*VeniceEnumObject) Compare ¶
func (v *VeniceEnumObject) Compare(otherAny VeniceValue) bool
func (*VeniceEnumObject) Equals ¶
func (v *VeniceEnumObject) Equals(otherAny VeniceValue) bool
func (*VeniceEnumObject) String ¶
func (v *VeniceEnumObject) String() string
type VeniceFunctionObject ¶
func (*VeniceFunctionObject) Compare ¶
func (v *VeniceFunctionObject) Compare(otherAny VeniceValue) bool
func (*VeniceFunctionObject) Equals ¶
func (v *VeniceFunctionObject) Equals(otherAny VeniceValue) bool
func (*VeniceFunctionObject) String ¶
func (v *VeniceFunctionObject) String() string
type VeniceInteger ¶
type VeniceInteger struct {
Value int
}
func (*VeniceInteger) Compare ¶
func (v *VeniceInteger) Compare(otherAny VeniceValue) bool
func (*VeniceInteger) Equals ¶
func (v *VeniceInteger) Equals(otherAny VeniceValue) bool
func (*VeniceInteger) String ¶
func (v *VeniceInteger) String() string
type VeniceIterator ¶
type VeniceIterator interface { VeniceValue Next() VeniceValue }
type VeniceList ¶
type VeniceList struct {
Values []VeniceValue
}
func (*VeniceList) Compare ¶
func (v *VeniceList) Compare(otherAny VeniceValue) bool
func (*VeniceList) Copy ¶
func (v *VeniceList) Copy() *VeniceList
func (*VeniceList) Equals ¶
func (v *VeniceList) Equals(otherAny VeniceValue) bool
func (*VeniceList) String ¶
func (v *VeniceList) String() string
type VeniceListIterator ¶
type VeniceListIterator struct { List *VeniceList Index int }
func NewVeniceListIterator ¶
func NewVeniceListIterator(list *VeniceList) *VeniceListIterator
func (*VeniceListIterator) Compare ¶
func (v *VeniceListIterator) Compare(otherAny VeniceValue) bool
func (*VeniceListIterator) Equals ¶
func (v *VeniceListIterator) Equals(otherAny VeniceValue) bool
func (*VeniceListIterator) Next ¶
func (v *VeniceListIterator) Next() VeniceValue
func (*VeniceListIterator) String ¶
func (v *VeniceListIterator) String() string
type VeniceMap ¶
type VeniceMap struct { Size int // contains filtered or unexported fields }
func NewVeniceMap ¶
func NewVeniceMap() *VeniceMap
func (*VeniceMap) Compare ¶
func (v *VeniceMap) Compare(otherAny VeniceValue) bool
func (*VeniceMap) Entries ¶
func (v *VeniceMap) Entries() *VeniceList
func (*VeniceMap) Equals ¶
func (v *VeniceMap) Equals(otherAny VeniceValue) bool
func (*VeniceMap) Get ¶
func (v *VeniceMap) Get(key VeniceValue) VeniceValue
func (*VeniceMap) Keys ¶
func (v *VeniceMap) Keys() *VeniceList
func (*VeniceMap) Put ¶
func (v *VeniceMap) Put(key VeniceValue, value VeniceValue)
func (*VeniceMap) Remove ¶
func (v *VeniceMap) Remove(key VeniceValue)
func (*VeniceMap) Values ¶
func (v *VeniceMap) Values() *VeniceList
type VeniceMapChain ¶
type VeniceMapChain struct { Key VeniceValue Value VeniceValue Next *VeniceMapChain }
Helper struct - does not implement VeniceValue
type VeniceMapIterator ¶
func NewVeniceMapIterator ¶
func NewVeniceMapIterator(vmap *VeniceMap) *VeniceMapIterator
func (*VeniceMapIterator) Compare ¶
func (v *VeniceMapIterator) Compare(otherAny VeniceValue) bool
func (*VeniceMapIterator) Equals ¶
func (v *VeniceMapIterator) Equals(otherAny VeniceValue) bool
func (*VeniceMapIterator) Next ¶
func (v *VeniceMapIterator) Next() VeniceValue
func (*VeniceMapIterator) String ¶
func (v *VeniceMapIterator) String() string
type VeniceRealNumber ¶
type VeniceRealNumber struct {
Value float64
}
func (*VeniceRealNumber) Compare ¶
func (v *VeniceRealNumber) Compare(otherAny VeniceValue) bool
func (*VeniceRealNumber) Equals ¶
func (v *VeniceRealNumber) Equals(otherAny VeniceValue) bool
func (*VeniceRealNumber) String ¶
func (v *VeniceRealNumber) String() string
type VeniceString ¶
type VeniceString struct {
Value string
}
func (*VeniceString) Compare ¶
func (v *VeniceString) Compare(otherAny VeniceValue) bool
func (*VeniceString) Equals ¶
func (v *VeniceString) Equals(otherAny VeniceValue) bool
func (*VeniceString) String ¶
func (v *VeniceString) String() string
type VeniceStringIterator ¶
type VeniceStringIterator struct { Str *VeniceString Index int }
func NewVeniceStringIterator ¶
func NewVeniceStringIterator(str *VeniceString) *VeniceStringIterator
func (*VeniceStringIterator) Compare ¶
func (v *VeniceStringIterator) Compare(otherAny VeniceValue) bool
func (*VeniceStringIterator) Equals ¶
func (v *VeniceStringIterator) Equals(otherAny VeniceValue) bool
func (*VeniceStringIterator) Next ¶
func (v *VeniceStringIterator) Next() VeniceValue
func (*VeniceStringIterator) String ¶
func (v *VeniceStringIterator) String() string
type VeniceTuple ¶
type VeniceTuple struct {
Values []VeniceValue
}
func (*VeniceTuple) Compare ¶
func (v *VeniceTuple) Compare(otherAny VeniceValue) bool
func (*VeniceTuple) Equals ¶
func (v *VeniceTuple) Equals(otherAny VeniceValue) bool
func (*VeniceTuple) String ¶
func (v *VeniceTuple) String() string
type VeniceValue ¶
type VeniceValue interface { fmt.Stringer Compare(v VeniceValue) bool Equals(v VeniceValue) bool Hash(h maphash.Hash) uint64 // contains filtered or unexported methods }
type VirtualMachine ¶
type VirtualMachine struct { Stack []VeniceValue Env *Environment }
func NewVirtualMachine ¶
func NewVirtualMachine() *VirtualMachine
func (*VirtualMachine) Execute ¶
func (vm *VirtualMachine) Execute( compiledProgram *bytecode.CompiledProgram, debug bool, ) (VeniceValue, error)
Click to show internal directories.
Click to hide internal directories.