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: [Exception, OSError, IOError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadDirEffect], forbids: [].}
Source   Edit  
proc genTopLevelNif(bModule: PPassContext; n: PNode) {.
    ...raises: [Exception, OSError, IOError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadDirEffect], forbids: [].}
Source   Edit  
proc setupNifgen(graph: ModuleGraph; module: PSym; idgen: IdGenerator): PPassContext {.
    ...raises: [OSError, Exception, IOError], tags: [ReadEnvEffect, ReadIOEffect,
    RootEffect, WriteIOEffect, ReadDirEffect, WriteDirEffect], forbids: [].}
Source   Edit