C# Class Shovel.Api

Mostrar archivo Open project: mbrezu/Shovel

Public Methods

Method Description
CheckStackTop ( Vm vm ) : Shovel.Value
DeserializeBytecode ( MemoryStream ms ) : Shovel.Instruction[]
DeserializeBytecode ( byte bytes ) : Shovel.Instruction[]
GetBytecode ( List sources ) : Shovel.Instruction[]
GetStructInstanceValue ( StructInstance str, string key, Shovel.Value defaultValue ) : Shovel.Value
ListStructInstanceKeys ( StructInstance str ) : string[]
MakeSources ( ) : List
MakeSourcesFromIEnumerable ( IEnumerable namesAndContents ) : List
MakeSourcesWithStdlib ( ) : List
PrintAssembledBytecode ( Instruction bytecode ) : string
PrintAssembledBytecode ( List sources ) : string
PrintRawBytecode ( List sources, bool optimize = false ) : string
RunVm ( Shovel bytecode, List sources, IEnumerable userPrimitives = null, byte state = null, int totalTicksQuota = null, int ticksUntilNextNapQuota = null, int usedCellsQuota = null ) : Vm
RunVm ( Vm vm, List sources, IEnumerable userPrimitives = null, int totalTicksQuota = null, int ticksUntilNextNapQuota = null, int usedCellsQuota = null ) : Vm
SerializeBytecode ( Instruction bytecode ) : byte[]
SerializeBytecodeToStream ( Instruction bytecode ) : MemoryStream
SerializeVmState ( Vm vm ) : byte[]
SerializeVmStateToStream ( Vm vm ) : Stream
SetStructInstanceValue ( StructInstance str, string key, Shovel.Value newValue ) : bool
SideBySide ( string str1, string str2, int halfSize = 38 ) : string
TestRunVm ( List sources ) : Shovel.Value
TestRunVm ( Shovel bytecode, List sources ) : Shovel.Value
VmExecutedTicks ( Vm vm ) : long
VmExecutedTicksSinceLastNap ( Vm vm ) : long
VmExecutionComplete ( Vm vm ) : bool
VmIsLive ( Vm vm ) : bool
VmProgrammingError ( Shovel vm ) : ShovelException
VmUsedCells ( Vm vm ) : int
VmUserDefinedPrimitiveError ( Shovel vm ) : Exception
WakeUpVm ( Vm vm ) : void

Method Details

CheckStackTop() public static method

public static CheckStackTop ( Vm vm ) : Shovel.Value
vm Vm
return Shovel.Value

DeserializeBytecode() public static method

public static DeserializeBytecode ( MemoryStream ms ) : Shovel.Instruction[]
ms System.IO.MemoryStream
return Shovel.Instruction[]

DeserializeBytecode() public static method

public static DeserializeBytecode ( byte bytes ) : Shovel.Instruction[]
bytes byte
return Shovel.Instruction[]

GetBytecode() public static method

public static GetBytecode ( List sources ) : Shovel.Instruction[]
sources List
return Shovel.Instruction[]

GetStructInstanceValue() public static method

public static GetStructInstanceValue ( StructInstance str, string key, Shovel.Value defaultValue ) : Shovel.Value
str StructInstance
key string
defaultValue Shovel.Value
return Shovel.Value

ListStructInstanceKeys() public static method

public static ListStructInstanceKeys ( StructInstance str ) : string[]
str StructInstance
return string[]

MakeSources() public static method

public static MakeSources ( ) : List
return List

MakeSourcesFromIEnumerable() public static method

public static MakeSourcesFromIEnumerable ( IEnumerable namesAndContents ) : List
namesAndContents IEnumerable
return List

MakeSourcesWithStdlib() public static method

public static MakeSourcesWithStdlib ( ) : List
return List

PrintAssembledBytecode() public static method

public static PrintAssembledBytecode ( Instruction bytecode ) : string
bytecode Instruction
return string

PrintAssembledBytecode() public static method

public static PrintAssembledBytecode ( List sources ) : string
sources List
return string

PrintRawBytecode() public static method

public static PrintRawBytecode ( List sources, bool optimize = false ) : string
sources List
optimize bool
return string

RunVm() public static method

public static RunVm ( Shovel bytecode, List sources, IEnumerable userPrimitives = null, byte state = null, int totalTicksQuota = null, int ticksUntilNextNapQuota = null, int usedCellsQuota = null ) : Vm
bytecode Shovel
sources List
userPrimitives IEnumerable
state byte
totalTicksQuota int
ticksUntilNextNapQuota int
usedCellsQuota int
return Shovel.Vm.Vm

RunVm() public static method

public static RunVm ( Vm vm, List sources, IEnumerable userPrimitives = null, int totalTicksQuota = null, int ticksUntilNextNapQuota = null, int usedCellsQuota = null ) : Vm
vm Vm
sources List
userPrimitives IEnumerable
totalTicksQuota int
ticksUntilNextNapQuota int
usedCellsQuota int
return Shovel.Vm.Vm

SerializeBytecode() public static method

public static SerializeBytecode ( Instruction bytecode ) : byte[]
bytecode Instruction
return byte[]

SerializeBytecodeToStream() public static method

public static SerializeBytecodeToStream ( Instruction bytecode ) : MemoryStream
bytecode Instruction
return System.IO.MemoryStream

SerializeVmState() public static method

public static SerializeVmState ( Vm vm ) : byte[]
vm Vm
return byte[]

SerializeVmStateToStream() public static method

public static SerializeVmStateToStream ( Vm vm ) : Stream
vm Vm
return Stream

SetStructInstanceValue() public static method

public static SetStructInstanceValue ( StructInstance str, string key, Shovel.Value newValue ) : bool
str StructInstance
key string
newValue Shovel.Value
return bool

SideBySide() public static method

public static SideBySide ( string str1, string str2, int halfSize = 38 ) : string
str1 string
str2 string
halfSize int
return string

TestRunVm() public static method

public static TestRunVm ( List sources ) : Shovel.Value
sources List
return Shovel.Value

TestRunVm() public static method

public static TestRunVm ( Shovel bytecode, List sources ) : Shovel.Value
bytecode Shovel
sources List
return Shovel.Value

VmExecutedTicks() public static method

public static VmExecutedTicks ( Vm vm ) : long
vm Vm
return long

VmExecutedTicksSinceLastNap() public static method

public static VmExecutedTicksSinceLastNap ( Vm vm ) : long
vm Vm
return long

VmExecutionComplete() public static method

public static VmExecutionComplete ( Vm vm ) : bool
vm Vm
return bool

VmIsLive() public static method

public static VmIsLive ( Vm vm ) : bool
vm Vm
return bool

VmProgrammingError() public static method

public static VmProgrammingError ( Shovel vm ) : ShovelException
vm Shovel
return Shovel.Exceptions.ShovelException

VmUsedCells() public static method

public static VmUsedCells ( Vm vm ) : int
vm Vm
return int

VmUserDefinedPrimitiveError() public static method

public static VmUserDefinedPrimitiveError ( Shovel vm ) : Exception
vm Shovel
return System.Exception

WakeUpVm() public static method

public static WakeUpVm ( Vm vm ) : void
vm Vm
return void