vm

package
v0.0.0-...-11fbe7f Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2016 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Globals map[string]PyObject
View Source
var PyTypes map[PyTypeId]*PyType

Init in init.go

Functions

This section is empty.

Types

type IntStack

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

func NewIntStack

func NewIntStack() *IntStack

type PyAttr

type PyAttr struct {
	Dict map[string]func(this *PyAttr, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyAttr

func NewPyAttr(self PyObject, attrName string) *PyAttr

type PyBool

type PyBool struct {
	Dict map[string]func(this *PyBool, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyBool

func NewPyBool(val bool) *PyBool

type PyBuiltInPrint

type PyBuiltInPrint struct {
	Dict map[string]func(this *PyBuiltInPrint, args []PyObject) PyObject
}

func NewPyBuiltInPrint

func NewPyBuiltInPrint() *PyBuiltInPrint

type PyByteCode

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

func NewPyByteCode

func NewPyByteCode(opcode PyOpCode, operand int) *PyByteCode

type PyCode

type PyCode struct {
	Dict map[string]func(this *PyCode, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyCode

func NewPyCode(name string, nestedFunc []*PyCode, locals []string, cellvars []string,
	freevars []string, globals []string, constants []PyObject, instrs []*PyByteCode, argc int) *PyCode

func Parse

func Parse(filename string) ([]*PyCode, error)

func (*PyCode) Name

func (this *PyCode) Name() string

type PyFloat

type PyFloat struct {
	Dict map[string]func(this *PyFloat, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyFloat

func NewPyFloat(val float64) *PyFloat

type PyFrame

type PyFrame struct {
	PC int
	// contains filtered or unexported fields
}

func NewPyFrame

func NewPyFrame(code *PyCode, args []PyObject, globals map[string]PyObject, consts []PyObject, cellvars map[string]PyObject) *PyFrame

type PyFunction

type PyFunction struct {
	Dict map[string]func(this *PyFunction, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyFunction

func NewPyFunction(code *PyCode, globals map[string]PyObject, env PyObject) *PyFunction

type PyInt

type PyInt struct {
	Dict map[string]func(this *PyInt, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyInt

func NewPyInt(val int) *PyInt

type PyList

type PyList struct {
	Dict map[string]func(this *PyList, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyList

func NewPyList(items []PyObject) *PyList

type PyNone

type PyNone struct{}

func NewPyNone

func NewPyNone() *PyNone

type PyObject

type PyObject interface {
	// contains filtered or unexported methods
}

func CallAttr

func CallAttr(obj PyObject, attrName string, args []PyObject) PyObject

type PyOpCode

type PyOpCode int
const (
	STOP_CODE PyOpCode = iota
	NOP
	POP_TOP
	ROT_TWO
	ROT_THREE
	DUP_TOP
	DUP_TOP_TWO
	UNARY_POSITIVE
	UNARY_NEGATIVE
	UNARY_NOT
	UNARY_INVERT
	GET_ITER
	BINARY_POWER
	BINARY_MULTIPLY
	BINARY_FLOOR_DIVIDE
	BINARY_TRUE_DIVIDE
	BINARY_MODULO
	BINARY_ADD
	BINARY_SUBTRACT
	BINARY_SUBSCR
	BINARY_LSHIFT
	BINARY_RSHIFT
	BINARY_AND
	BINARY_XOR
	BINARY_OR
	INPLACE_POWER
	INPLACE_MULTIPLY
	INPLACE_FLOOR_DIVIDE
	INPLACE_TRUE_DIVIDE
	INPLACE_MODULO
	INPLACE_ADD
	INPLACE_SUBTRACT
	INPLACE_LSHIFT
	INPLACE_RSHIFT
	INPLACE_AND
	INPLACE_XOR
	INPLACE_OR
	STORE_SUBSCR
	DELETE_SUBSCR
	PRINT_EXPR
	BREAK_LOOP
	CONTINUE_LOOP
	SET_ADD
	LIST_APPEND
	MAP_ADD
	RETURN_VALUE
	YIELD_VALUE
	IMPORT_STAR
	POP_BLOCK
	POP_EXCEPT
	END_FINALLY
	LOAD_BUILD_CLASS
	SETUP_WITH
	WITH_CLEANUP
	STORE_LOCALS
	STORE_NAME
	DELETE_NAME
	UNPACK_SEQUENCE
	UNPACK_EX
	STORE_ATTR
	DELETE_ATTR
	STORE_GLOBAL
	DELETE_GLOBAL
	LOAD_CONST
	LOAD_NAME
	BUILD_TUPLE
	SELECT_TUPLE
	BUILD_LIST
	BUILD_SET
	BUILD_MAP
	LOAD_ATTR
	COMPARE_OP
	IMPORT_NAME
	IMPORT_FROM
	JUMP_FORWARD
	POP_JUMP_IF_TRUE
	POP_JUMP_IF_FALSE
	JUMP_IF_TRUE_OR_POP
	JUMP_IF_FALSE_OR_POP
	JUMP_ABSOLUTE
	FOR_ITER
	LOAD_GLOBAL
	SETUP_LOOP
	SETUP_EXCEPT
	SETUP_FINALLY
	STORE_MAP
	LOAD_FAST
	STORE_FAST
	DELETE_FAST
	LOAD_CLOSURE
	LOAD_DEREF
	STORE_DEREF
	DELETE_DEREF
	RAISE_VARARGS
	CALL_FUNCTION
	MAKE_FUNCTION
	MAKE_CLOSURE
	BUILD_SLICE
	EXTENDED_ARG
	CALL_FUNCTION_VAR
	CALL_FUNCTION_KW
	CALL_FUNCTION_VAR_KW
	HAVE_ARGUMENT
)

type PyStack

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

func NewPyStack

func NewPyStack() *PyStack

type PyStr

type PyStr struct {
	Dict map[string]func(this *PyStr, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyStr

func NewPyStr(s string) *PyStr

type PyTuple

type PyTuple struct {
	Dict map[string]func(this *PyTuple, args []PyObject) PyObject
	// contains filtered or unexported fields
}

func NewPyTuple

func NewPyTuple(items []PyObject) *PyTuple

type PyType

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

func NewPyType

func NewPyType(typeString string, id PyTypeId) *PyType

type PyTypeId

type PyTypeId int
const (
	PyTypeType PyTypeId = iota
	PyNoneType
	PyBoolType
	PyIntType
	PyFloatType
	PyStrType
	PyFunctionType
	PyBuiltInType
	PyRangeTypeId
	PyListType
	PyCodeType
	PyTupleType
)

Jump to

Keyboard shortcuts

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