src/vms/nimc/nimcvm

Source   Edit  

Types

Initialize = proc (oldStateLib: pointer) {.stdcall.}
Source   Edit  
NimCVm = ref object of Vm
Source   Edit  
Run = proc (state: pointer): (string, string) {.stdcall.}
Source   Edit  

Consts

libExt = ".dylib"
Source   Edit  

Procs

proc newNimCVm(compiler: Compiler; tmpPath: string = getTempDir()): NimCVm {.
    ...raises: [IOError], tags: [WriteIOEffect], forbids: [].}
Creates a new Virtual Machine that compiles nim code commands to run them. The VM uses the given compiler and temporary path. Strengths: maximizes compatibility, allows integration with native code. Weaknesses: it takes some time to compile each command and declaration. Source   Edit  

Methods

method clean(self: NimCVm) {....raises: [], tags: [], forbids: [].}
Source   Edit  
method runCommand(self: NimCVm; command: string): (string, int) {.
    ...raises: [IOError, OSError, Exception],
    tags: [WriteIOEffect, ExecIOEffect, ReadIOEffect, RootEffect], forbids: [].}
Source   Edit  
method updateDeclarations(self: NimCVm): (string, int) {.
    ...raises: [IOError, OSError],
    tags: [WriteIOEffect, ExecIOEffect, ReadIOEffect, RootEffect], forbids: [].}
Source   Edit  
method updateImports(self: NimCVm): (string, int) {....raises: [IOError, OSError],
    tags: [WriteIOEffect, ExecIOEffect, ReadIOEffect, RootEffect], forbids: [].}
Source   Edit  
method updateState(self: NimCVm): (string, int) {.
    ...raises: [IOError, OSError, KeyError, Exception],
    tags: [WriteIOEffect, ExecIOEffect, ReadIOEffect, RootEffect], forbids: [].}
Source   Edit