nifgen

Source   Edit  

This module implements the NIF code generator.This was copied from Nifler's bridge.nim. However, this code will evolve in a different direction as it needs to translate the semchecked AST which is way more complex. For example, all magics need to be special cased.

Types

NifModule = ref object of PPassContext
  graph*: ModuleGraph
  module*: PSym
Source   Edit  

Procs

proc addFloatLit(b: var Builder; u: BiggestFloat; suffix: string) {.
    ...raises: [IOError], tags: [WriteIOEffect], forbids: [].}
Source   Edit  
proc addIntLit(b: var Builder; u: BiggestInt; suffix: string) {.
    ...raises: [IOError], tags: [WriteIOEffect], forbids: [].}
Source   Edit  
proc addUIntLit(b: var Builder; u: BiggestUInt; suffix: string) {.
    ...raises: [IOError], tags: [WriteIOEffect], forbids: [].}
Source   Edit  
proc close(c: var TranslationContext) {....raises: [IOError],
                                        tags: [WriteIOEffect], forbids: [].}
Source   Edit  
proc closeNif(graph: ModuleGraph; bModule: PPassContext; finalNode: PNode) {.
    ...raises: [KeyError, ValueError, IOError, Exception, OSError], tags: [
    WriteIOEffect, ReadDirEffect, RootEffect, ReadEnvEffect, ReadIOEffect],
    forbids: [].}
Source   Edit  
proc genTopLevelNif(bModule: PPassContext; n: PNode) {.
    ...raises: [KeyError, ValueError, IOError, Exception, OSError], tags: [
    WriteIOEffect, ReadDirEffect, RootEffect, ReadEnvEffect, ReadIOEffect],
    forbids: [].}
Source   Edit  
proc setupNifgen(graph: ModuleGraph; module: PSym; idgen: IdGenerator): PPassContext {.
    ...raises: [OSError, IOError, Exception, KeyError, ValueError], tags: [
    ReadEnvEffect, ReadIOEffect, ReadDirEffect, WriteDirEffect, RootEffect,
    WriteIOEffect], forbids: [].}
Source   Edit