'Write the code by calling language specific methods.
The generated file contains all the definitions of the routines in
low-level code and refers to the header file if appropriate.
Parameters
routines : list
A list of Routine instances.
f : file-like
Where to write the file.
prefix : string
The filename prefix, used to refer to the proper header file.
Only the basename of the prefix is used.
header : bool, optional
When True, a header comment is included on top of each source
file.  [default : True]
empty : bool, optional
When True, empty lines are included to structure the source
files.  [default : True]'

def dump_code(self, routines, f, prefix, header=True, empty=True):

    code_lines = self._preprocessor_statements(prefix)
    for routine in routines:
        if empty:
            code_lines.append('\n')
        code_lines.extend(self._get_routine_opening(routine))
        code_lines.extend(self._declare_arguments(routine))
        code_lines.extend(self._declare_globals(routine))
        code_lines.extend(self._declare_locals(routine))
        if empty:
            code_lines.append('\n')
        code_lines.extend(self._call_printer(routine))
        if empty:
            code_lines.append('\n')
        code_lines.extend(self._get_routine_ending(routine))
    code_lines = self._indent_code(''.join(code_lines))
    if header:
        code_lines = ''.join((self._get_header() + [code_lines]))
    if code_lines:
        f.write(code_lines)
