CodeGen (code_gen v0.2.1)
Documentation for CodeGen
.
examples
Examples
use CodeGen,
module: TemplateModule,
options: [
a: 1,
b: :x,
c: "abc"
]
Link to this section Summary
Functions
Define a named code block for code generation.
Get the names of the generated blocks.
Returns the generated blocks as a list of pairs of the form {name, code}
,
where code is the binary representation of the code.
Dumps the source code of a generated block into the module's file.
The new code is added to the end of the module (just before the closing end
tag).
Displays the generated blocks
Displays the generated blocks
Link to this section Functions
Define a named code block for code generation.
This macro simply returns its contents such that the source of the expressions inside the block can be dumped by the user into the host's module file.
block_names(module)
Get the names of the generated blocks.
blocks(module)
Returns the generated blocks as a list of pairs of the form {name, code}
,
where code is the binary representation of the code.
dump_source(module, block_name)
Dumps the source code of a generated block into the module's file.
The new code is added to the end of the module (just before the closing end
tag).
show_block(module, name)
Displays the generated blocks
show_blocks(module)
Displays the generated blocks