'Generates the code into file, an open file buffer.'

def generate(self, file=None):

    src = Template(_PROLOGUE_COMMENT).substitute(cfg_filename=self.cfg_filename)
    src += _PROLOGUE_CODE
    for node_cfg in self.node_cfg:
        src += (node_cfg.generate_source() + '\n\n')
    file.write(src)
