GrEngine

Grimoire's virtual machine.

class GrEngine {}

Constructors

this
this()

Default.

Members

Aliases

getBoolVariable
alias getBoolVariable = getVariable!bool
Undocumented in source.
getFloatVariable
alias getFloatVariable = getVariable!GrFloat
Undocumented in source.
getIntVariable
alias getIntVariable = getVariable!GrInt
Undocumented in source.
getPtrVariable
alias getPtrVariable = getVariable!GrPtr
Undocumented in source.
getStringVariable
alias getStringVariable = getVariable!GrString
Undocumented in source.
setBoolVariable
alias setBoolVariable = setVariable!GrBool
Undocumented in source.
setFloatVariable
alias setFloatVariable = setVariable!GrFloat
Undocumented in source.
setIntVariable
alias setIntVariable = setVariable!GrInt
Undocumented in source.
setPtrVariable
alias setPtrVariable = setVariable!GrPtr
Undocumented in source.
setStringVariable
alias setStringVariable = setVariable!GrString
Undocumented in source.

Classes

DebugFunction
class DebugFunction

Runtime information of a called function

Functions

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)

Create a new object.

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)

Load the 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.

Properties

hasCoroutines
bool hasCoroutines [@property getter]

Check if there is a coroutine currently running.

isPanicking
bool isPanicking [@property getter]

Whether the whole VM has panicked, true if an unhandled error occurred.

meta
string meta [@property getter]
string meta [@property setter]

Extra type compiler information.

panicMessage
string panicMessage [@property getter]

The unhandled error message.

stackTraces
const(GrStackTrace[]) stackTraces [@property getter]

If the VM has raised an error, stack traces are generated.

Variables

isRunning
bool isRunning;

External way of stopping the VM.

Meta