| Class | Voodoo::CommonCodeGenerator |
| In: |
voodoo/generators/common_code_generator.rb
|
| Parent: | Object |
Common base class for code generators.
Code generators are expected to implement the following methods:
This class contains base implementations of some of these methods, which can be used and/or overridden by subclasses.
An example of how to use the code generators provided by this module is provided on the main page of the documentation of the Voodoo module.
Initializes the code generator. params shall be a hash containing parameters to the code generator, and shall at least contain the keys :architecture and :format, specifying the target architecture and output format, respectively.
Adds code to the given section.
Examples:
add :code, [:return, 0] add :data, [:align], [:label, :xyzzy], [:word, 42]
This method implements the required functionality in terms of the following methods, which must be implemented by subclasses:
Set up alias_name to refer to the same section as original_name.