def makeModuleSource( tree ):
    generator_module = Generator.PythonModuleGenerator(
        module_name = tree.getName(),
    )

    _prepareCodeGeneration( tree )

    source_code = CodeGeneration.generateModuleCode(
        module         = tree,
        module_name    = tree.getName(),
        generator      = generator_module,
        global_context = Contexts.PythonGlobalContext(),
        stand_alone    = True
    )

    return source_code