Translation Scheme vox.compilers.Compiler

This interface describes the translation scheme/compiler that should be returned from the factory function passed to vox.compile . Note that the before and after methods are both optional, and will be replaced with no-ops if omitted.

Methods

Call methods with.name(),.name(arguments)or just .name arguments .

  • after (strands) -> undefined#

    Function to execute after the iterator looks at each voxel

    Parameters
    strands
    vox.dna.Strand[]

    If the compiler modifies any strands, it should modify this array.

  • before (strands) -> undefined#

    Function to execute before the iterator looks at each voxel

    Parameters
    strands
    vox.dna.Strand[]

    If the compiler generates any strand(s) before examining the voxels, they should be pushed into/spliced into this array.

  • iterator (a, b, c, strands) -> undefined#

    Iterator function which is called on each voxel.

    Parameters
    a
    Number
    b
    Number
    c
    Number
    strands
    vox.dna.Strand[]

    If the iterator generates any strand(s) for this voxel, they should be pushed into/spliced into this array.