- addLibrary
void addLibrary(GrLibrary library)
Add a new library to the runtime.
___
It must be called before loading the bytecode.
It should be loading the same library as the compiler
and in the same order.
- createObject
GrObject createObject(string name)
- dumpProfiling
DebugFunction[int] dumpProfiling()
Runtime information about every called functions
- getEnumVariable
T getEnumVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getFloatArrayVariable
GrFloatArray getFloatArrayVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getFloatChannelVariable
GrFloatChannel getFloatChannelVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getForeignVariable
T getForeignVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getIntArrayVariable
GrIntArray getIntArrayVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getIntChannelVariable
GrIntChannel getIntChannelVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getObjectArrayVariable
GrObjectArray getObjectArrayVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getObjectChannelVariable
GrObjectChannel getObjectChannelVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getObjectVariable
GrObject getObjectVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getStringArrayVariable
GrStringArray getStringArrayVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- getStringChannelVariable
GrStringChannel getStringChannelVariable(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- hasEvent
bool hasEvent(string eventName)
Checks whether an event exists. \
eventName must be the mangled name of the event.
- load
void load(GrBytecode bytecode)
- panic
void panic()
Captures an unhandled error and kill the VM.
- prettifyProfiling
string prettifyProfiling()
Prettify the result from dumpProfiling
- process
void process()
Run the vm until all the contexts are finished or in yield.
- pushContext
void pushContext(GrContext context)
Undocumented in source. Be warned that the author may not have intended to support it.
- raise
void raise(GrContext context, string message)
Raise an error message and attempt to recover from it. \
The error is raised inside a coroutine. \
___
For each function it unwinds, it'll search for a try/catch that captures it. \
If none is found, it'll execute every defer statements inside the function and
do the same for the next function in the callstack.
___
If nothing catches the error inside the coroutine, the VM enters in a panic state. \
Every coroutines will then execute their defer statements and be killed.
- setEnumVariable
void setEnumVariable(string name, T value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setFloatArrayVariable
void setFloatArrayVariable(string name, GrFloatArray value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setFloatChannelVariable
void setFloatChannelVariable(string name, GrFloatChannel value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setForeignVariable
void setForeignVariable(string name, T value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setIntArrayVariable
void setIntArrayVariable(string name, GrIntArray value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setIntChannelVariable
void setIntChannelVariable(string name, GrIntChannel value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setObjectArrayVariable
void setObjectArrayVariable(string name, GrObjectArray value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setObjectChannelVariable
void setObjectChannelVariable(string name, GrObjectChannel value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setObjectVariable
void setObjectVariable(string name, GrObject value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setStringArrayVariable
void setStringArrayVariable(string name, GrStringArray value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setStringChannelVariable
void setStringChannelVariable(string name, GrStringChannel value)
Undocumented in source. Be warned that the author may not have intended to support it.
- spawn
void spawn()
Create the main context.
You must call this function before running the vm.
- spawnEvent
GrContext spawnEvent(string eventName)
Spawn a new coroutine registered as an event. \
eventName must be the mangled name of the event.
Grimoire's virtual machine.