Ejemplo n.º 1
0
def process_file(arg, filename):
    """Process the xcpp file. """
    cfg = get_cfg(arg, 'cpp', DEFAULTS)
    cfg['xcpp']['filename'] = extract_name(filename)
    xcfile = FileParser(filename).parse()
    check_inputs(xcfile, cfg, 'cpp')
    for func in xcfile.function:
        process_function(xcfile, cfg, func)
Ejemplo n.º 2
0
def process_file(arg, filename):
    """Process the xcpp file. """
    cfg = get_cfg(arg, 'matlab', DEFAULTS)
    cfg['xcpp']['filename'] = extract_name(filename)
    xcfile = FileParser(filename).parse()
    cfg['matlab']['opt'] = cfg['matlab']['cxxopt']
    in_map, defs = check_inputs(xcfile, cfg, 'matlab')

    cfg['matlab']['cxx'] = 'mex'
    root = cfg['xcpp']['root']
    matlabdir = cfg['matlab']['wrapper']
    if matlabdir[0] == '/':
        base = matlabdir
    else:
        base = '%s/%s' % (root, matlabdir)
    cfg['matlab']['pkg'] = '%s/+%s' % (base, cfg['xcpp']['filename'])
    if not os.path.exists(cfg['matlab']['pkg']):
        os.mkdir(cfg['matlab']['pkg'])
    cfg['matlab']['opt'] = cfg['matlab']['mexopt']

    if defs:
        write_matlab_defs(cfg, defs)
    for func in xcfile.function:
        write_cpp_function(xcfile, func, cfg)
        write_matlab_file(func, cfg, in_map)
Ejemplo n.º 3
0
def process_file(arg, filename):
    """Process the xcpp file. """
    cfg = get_cfg(arg, 'mathematica', DEFAULTS)
    cfg['xcpp']['filename'] = extract_name(filename)
    xcfile = FileParser(filename).parse()
    in_map, _ = check_inputs(xcfile, cfg, 'mathematica')
    write_cpp_file(xcfile, cfg, in_map)
    write_m_file(xcfile, cfg)
Ejemplo n.º 4
0
def process_file(arg, filename):
    """Process the xcpp file. """
    cfg = get_cfg(arg, 'python', DEFAULTS)
    cfg['xcpp']['filename'] = extract_name(filename)
    xcfile = FileParser(filename).parse()
    in_map, defs = check_inputs(xcfile, cfg, 'python')
    write_cpp_file(xcfile, cfg)
    write_python_file(xcfile, cfg, in_map, defs)