"""

This main program translates one module to a C++ source code using Python C/API and
optionally compiles it to either an executable or an extension module.

"""

import MainControl
import Options

import sys

# Turn that source code into a node tree structure.
tree = MainControl.createNodeTree(
    filename = Options.getPositionalArgs()[0]
)

cpp_filename = Options.getOutputPath(
    tree.getName() + ".c++"
)

if not Options.shallOnlyExecGcc():
    if Options.shallDumpBuiltTree():
        MainControl.dumpTree( tree )

    if Options.shallDisplayBuiltTree():
        MainControl.displayTree( tree )

    # Now build the target language code
    if Options.shallMakeModule():