Méthode | Description | |
---|---|---|
AddTrigger ( int triggerFunctionPointer ) : void | ||
AddVariable ( kOS.Safe.Execution.Variable variable, string identifier, bool local, bool overwrite = false ) : void |
Make a new variable at either the local depth or the global depth depending. throws exception if it already exists as a boundvariable at the desired scope level, unless overwrite = true.
|
|
AssertValidDelegateCall ( IUserDelegate userDelegate ) : void |
Throw exception if the user delegate is not one the CPU can call right now.
|
|
Boot ( ) : void | ||
BreakExecution ( bool manual ) : void | ||
BuiltInExists ( string functionName ) : bool | ||
CPU ( SafeSharedObjects shared ) : System | ||
CallBuiltinFunction ( string functionName ) : void | ||
Dispose ( ) : void | ||
DumpStack ( ) : string | ||
DumpVariables ( ) : string | ||
GetCallTrace ( ) : List |
Return the subroutine call trace of how the code got to where it is right now.
|
|
GetCodeFragment ( int contextLines ) : List |
||
GetCurrentClosure ( ) : List |
Build a clone of the current state of the scope stack, for the sake of capturing a closure.
|
|
GetCurrentOpcode ( ) : |
||
GetInterpreterContext ( ) : IProgramContext | ||
GetOpcodeAt ( int instructionPtr ) : Opcode | ||
GetStackSize ( ) : int | ||
GetStructureEncapsulated ( Structure testValue, bool barewordOkay = false ) : Structure |
Identical to GetValue(), except that it guarantees the return value is either already a Structure, or it converts it into a Structure if it's a primitive. It bombs out with an exception if it can't be converted thusly.
|
|
GetValue ( object testValue, bool barewordOkay = false ) : object |
Given a value which may or may not be a variable name, return the value back. If it's not a variable, return it as-is. If it's a variable, look it up and return that.
|
|
IdentifierExistsInScope ( string identifier ) : bool |
Test if an identifier is a variable you can get the value of at the moment (var name exists and is in scope). Return true if you can, false if you can't.
|
|
KOSFixedUpdate ( double deltaTime ) : void | ||
MakeUserDelegate ( int entryPoint, bool withClosure ) : IUserDelegate |
Build a delegate call for the given function entry point, in which it will capture a closure of the current runtime scoping state to be used when that function gets called later by OpcodeCall:
|
|
MoveStackPointer ( int delta ) : void | ||
PeekRaw ( int digDepth, bool &checkOkay ) : object |
Peek at a value atop the stack without popping it, and without evaluating it to get the variable's value. (i.e. if the thing in the stack is $foo, and the variable foo has value 5, you'll get the string "$foo" returned, not the integer 5).
|
|
PeekStructureEncapsulated ( int digDepth, bool barewordOkay = false ) : Structure |
Identical to PeekValue(), except that it guarantees the return value is either already a Structure, or it converts it into a Structure if it's a primitive. It bombs out with an exception if it can't be converted thusly.
|
|
PeekValue ( int digDepth, bool barewordOkay = false ) : object |
Peek at a value atop the stack without popping it, and if it's a variable name then get its value, else just return it as it is.
|
|
PeekValueEncapsulated ( int digDepth, bool barewordOkay = false ) : object |
Identical to PeekStructureEncapsulated(), except that it doesn't complain if the result can't be converted to a Structure. It's acceptable for it to not be a Structure, in which case the original object is returned as-is.
|
|
PopAboveStack ( int howMany ) : object |
Pop one or more things from the secret "over" stack, only returning the finalmost thing popped. (i.e if you pop 3 things then you get: pop once and throw away, pop again and throw away, pop again and return the popped thing.)
|
|
PopStack ( ) : object | ||
PopStructureEncapsulated ( bool barewordOkay = false ) : Structure |
Identical to PopValue(), except that it guarantees the return value is either already a Structure, or it converts it into a Structure if it's a primitive. It bombs out with an exception if it can't be converted thusly.
|
|
PopValue ( bool barewordOkay = false ) : object |
Pop a value off the stack, and if it's a variable name then get its value, else just return it as it is.
|
|
PopValueEncapsulated ( bool barewordOkay = false ) : object |
Identical to PopStructureEncapsulated(), except that it doesn't complain if the result can't be converted to a Structure. It's acceptable for it to not be a Structure, in which case the original object is returned as-is.
|
|
PushAboveStack ( object thing ) : void |
Push a single thing onto the secret "over" stack.
|
|
PushStack ( object item ) : void | ||
RemoveTrigger ( int triggerFunctionPointer ) : void | ||
RemoveVariable ( string identifier ) : void |
Removes a variable, following current scoping rules, removing the innermost scope of the variable that is found.
|
|
ResetStatistics ( ) : void | ||
RunProgram ( List |
||
RunProgram ( List |
||
SelectAutopilotMode ( string autopilotMode ) : void | ||
SetGlobal ( string identifier, object value ) : void |
Make a new global variable at the localmost scoping level and give it a starting value, or overwrite an existing variable at the localmost level with a starting value.
|
|
SetNewLocal ( string identifier, object value ) : void |
Try to make a new local variable at the localmost scoping level and give it a starting value. It errors out of there is already one there by the same name.
|
|
SetValue ( string identifier, object value ) : void |
Try to set the value of the identifier at the localmost level possible, by scanning up the scope stack to find the local-most level at which the identifier is a variable, and assigning it the value there.
|
|
SetValueExists ( string identifier, object value ) : void |
Try to set the value of the identifier at the localmost level possible, by scanning up the scope stack to find the local-most level at which the identifier is a variable, and assigning it the value there.
|
|
StartCompileStopwatch ( ) : void | ||
StatisticsDump ( bool doProfiling ) : string | ||
StopCompileStopwatch ( ) : void | ||
SwitchToProgramContext ( ) : IProgramContext | ||
ToggleFlyByWire ( string paramName, bool enabled ) : void | ||
VariableIsRemovable ( Variable variable ) : bool | ||
YieldProgram ( YieldFinishedDetector yieldTracker ) : void |
Call when you want to suspend execution of the Opcodes until some future condition becomes true. The CPU will call yieldTracker.Begin() right away, and then after that call yieldTracker.IsFinished() again and again until it returns true. Until IsFinished() returns true, the CPU will not advance any further into the program in its current "mode". Note that the CPU will track "trigger" and "mainline" code separately for this purpose. Waiting in mainline code will still allow triggers to run.
|
Méthode | Description | |
---|---|---|
AbortAllYields ( ) : void | ||
CalculateProfileResult ( ) : void | ||
ContinueExecution ( bool doProfiling ) : void | ||
ExecuteInstruction ( IProgramContext context, bool doProfiling ) : bool | ||
GetNestedDictionary ( int peekDepth ) : VariableScope |
Gets the dictionary N levels of nesting down the dictionary stack, where zero is the current localmost level. Never errors out or fails. If N is too large you just end up with the global scope dictionary. Does not allow the walk to go past the start of the current function scope.
|
|
GetNestedDictionary ( string identifier, List |
Gets the dictionary that contains the given identifier, starting the search at the local level and scanning the scopes upward all the way to the global dictionary.
|
|
GetOrCreateVariable ( string identifier ) : Variable |
Get the value of a variable or create it at global scope if not found.
|
|
GetVariable ( string identifier, bool barewordOkay = false, bool failOkay = false ) : Variable |
Get the variable's contents, performing a lookup through all nesting levels up to global.
|
|
IsYielding ( ) : bool | ||
PopContext ( ) : void | ||
PopFirstContext ( ) : void | ||
PostUpdateBindings ( ) : void | ||
PreUpdateBindings ( ) : void | ||
PrintStatistics ( ) : void | ||
ProcessTriggers ( ) : void | ||
PushContext ( ProgramContext context ) : void | ||
PushInterpreterContext ( ) : void | ||
RestorePointers ( ) : void | ||
SaveAndClearPointers ( ) : void | ||
SkipCurrentInstructionId ( ) : void |
public AddTrigger ( int triggerFunctionPointer ) : void | ||
triggerFunctionPointer | int | |
Résultat | void |
public AddVariable ( kOS.Safe.Execution.Variable variable, string identifier, bool local, bool overwrite = false ) : void | ||
variable | kOS.Safe.Execution.Variable | variable to add |
identifier | string | name of variable to add |
local | bool | true if you want to make it at local depth |
overwrite | bool | true if it's okay to overwrite an existing variable |
Résultat | void |
public AssertValidDelegateCall ( IUserDelegate userDelegate ) : void | ||
userDelegate | IUserDelegate | The userdelegate being checked |
Résultat | void |
public BreakExecution ( bool manual ) : void | ||
manual | bool | |
Résultat | void |
public BuiltInExists ( string functionName ) : bool | ||
functionName | string | |
Résultat | bool |
public CPU ( SafeSharedObjects shared ) : System | ||
shared | SafeSharedObjects | |
Résultat | System |
public CallBuiltinFunction ( string functionName ) : void | ||
functionName | string | |
Résultat | void |
public GetCodeFragment ( int contextLines ) : List |
||
contextLines | int | |
Résultat | List |
public GetCurrentOpcode ( ) : |
||
Résultat |
public GetInterpreterContext ( ) : IProgramContext | ||
Résultat | IProgramContext |
public GetOpcodeAt ( int instructionPtr ) : Opcode | ||
instructionPtr | int | |
Résultat | Opcode |
public GetStructureEncapsulated ( Structure testValue, bool barewordOkay = false ) : Structure | ||
testValue | Structure | the object which might be a variable name |
barewordOkay | bool | /// Is this a case in which it's acceptable for the /// variable not to exist, and if it doesn't exist then the variable name itself /// is the value? /// |
Résultat | Structure |
public GetValue ( object testValue, bool barewordOkay = false ) : object | ||
testValue | object | the object which might be a variable name |
barewordOkay | bool | /// Is this a case in which it's acceptable for the /// variable not to exist, and if it doesn't exist then the variable name itself /// is the value? /// |
Résultat | object |
public IdentifierExistsInScope ( string identifier ) : bool | ||
identifier | string | |
Résultat | bool |
public KOSFixedUpdate ( double deltaTime ) : void | ||
deltaTime | double | |
Résultat | void |
public MakeUserDelegate ( int entryPoint, bool withClosure ) : IUserDelegate | ||
entryPoint | int | Integer location in memory to jump to to start the call |
withClosure | bool | Should the closure be captured for this delegate or ignored |
Résultat | IUserDelegate |
public MoveStackPointer ( int delta ) : void | ||
delta | int | |
Résultat | void |
public PeekRaw ( int digDepth, bool &checkOkay ) : object | ||
digDepth | int | Peek at the element this far down the stack (0 means top, 1 means just under the top, etc) |
checkOkay | bool | Tells you whether or not the stack was exhausted. If it's false, then the peek went too deep. |
Résultat | object |
public PeekStructureEncapsulated ( int digDepth, bool barewordOkay = false ) : Structure | ||
digDepth | int | Peek at the element this far down the stack (0 means top, 1 means just under the top, etc) |
barewordOkay | bool | Is this a context in which it's acceptable for /// a variable not existing error to occur (in which case the identifier itself /// should therefore become a string object returned)? |
Résultat | Structure |
public PeekValue ( int digDepth, bool barewordOkay = false ) : object | ||
digDepth | int | Peek at the element this far down the stack (0 means top, 1 means just under the top, etc) |
barewordOkay | bool | Is this a context in which it's acceptable for /// a variable not existing error to occur (in which case the identifier itself /// should therefore become a string object returned)? |
Résultat | object |
public PeekValueEncapsulated ( int digDepth, bool barewordOkay = false ) : object | ||
digDepth | int | Peek at the element this far down the stack (0 means top, 1 means just under the top, etc) |
barewordOkay | bool | Is this a context in which it's acceptable for /// a variable not existing error to occur (in which case the identifier itself /// should therefore become a string object returned)? |
Résultat | object |
public PopAboveStack ( int howMany ) : object | ||
howMany | int | |
Résultat | object |
public PopStructureEncapsulated ( bool barewordOkay = false ) : Structure | ||
barewordOkay | bool | Is this a context in which it's acceptable for /// a variable not existing error to occur (in which case the identifier itself /// should therefore become a string object returned)? |
Résultat | Structure |
public PopValue ( bool barewordOkay = false ) : object | ||
barewordOkay | bool | Is this a context in which it's acceptable for /// a variable not existing error to occur (in which case the identifier itself /// should therefore become a string object returned)? |
Résultat | object |
public PopValueEncapsulated ( bool barewordOkay = false ) : object | ||
barewordOkay | bool | Is this a context in which it's acceptable for /// a variable not existing error to occur (in which case the identifier itself /// should therefore become a string object returned)? |
Résultat | object |
public PushAboveStack ( object thing ) : void | ||
thing | object | |
Résultat | void |
public RemoveTrigger ( int triggerFunctionPointer ) : void | ||
triggerFunctionPointer | int | |
Résultat | void |
public RemoveVariable ( string identifier ) : void | ||
identifier | string | varible to remove. |
Résultat | void |
public RunProgram ( List |
||
program | List |
|
silent | bool | |
Résultat | void |
public SelectAutopilotMode ( string autopilotMode ) : void | ||
autopilotMode | string | |
Résultat | void |
public SetGlobal ( string identifier, object value ) : void | ||
identifier | string | variable name to attempt to store into |
value | object | value to put into it |
Résultat | void |
public SetNewLocal ( string identifier, object value ) : void | ||
identifier | string | variable name to attempt to store into |
value | object | value to put into it |
Résultat | void |
public SetValue ( string identifier, object value ) : void | ||
identifier | string | variable name to attempt to store into |
value | object | value to put into it |
Résultat | void |
public SetValueExists ( string identifier, object value ) : void | ||
identifier | string | variable name to attempt to store into |
value | object | value to put into it |
Résultat | void |
public StatisticsDump ( bool doProfiling ) : string | ||
doProfiling | bool | |
Résultat | string |
public SwitchToProgramContext ( ) : IProgramContext | ||
Résultat | IProgramContext |
public ToggleFlyByWire ( string paramName, bool enabled ) : void | ||
paramName | string | |
enabled | bool | |
Résultat | void |
public VariableIsRemovable ( Variable variable ) : bool | ||
variable | Variable | |
Résultat | bool |
public YieldProgram ( YieldFinishedDetector yieldTracker ) : void | ||
yieldTracker | YieldFinishedDetector | |
Résultat | void |