コード例 #1
0
ファイル: fortran.py プロジェクト: strategist922/libsoc
def create_module():
    global types, interface, contains
    with open("../fortran/libsoc.f03", "w") as f:
        common.output_file = f
        common.print_license_string(language="fortran")
        print(file=f)
        print("module libsoc", file=f)
        print(file=f)
        print("\tuse iso_c_binding", file=f)
        print(file=f)
        print("\timplicit none", file=f)
        print(file=f)
        print("\tinteger, parameter :: dp = selected_real_kind(15, 307)",
              file=f)
        print(file=f)

        print(types, end='', file=f)

        interface += "\tend interface\n"
        interface = line_break(interface)
        print(interface, file=f)

        contains = line_break(contains)
        print(contains, end='', file=f)
        print("end module libsoc", file=f)
コード例 #2
0
ファイル: fortran.py プロジェクト: rikardn/libsoc
def create_module():
    global types, interface, contains
    with open("../fortran/libsoc.f03", "w") as f: 
        common.output_file = f
        common.print_license_string(language="fortran")
        print(file=f)
        print("module libsoc", file=f)
        print(file=f)
        print("\tuse iso_c_binding", file=f)
        print(file=f)
        print("\timplicit none", file=f)
        print(file=f)
        print("\tinteger, parameter :: dp = selected_real_kind(15, 307)", file=f)
        print(file=f)

        print(types, end='', file=f)

        interface += "\tend interface\n"
        interface = line_break(interface)
        print(interface, file=f)

        contains = line_break(contains)
        print(contains, end='', file=f)
        print("end module libsoc", file=f)
コード例 #3
0
ファイル: R.py プロジェクト: strategist922/libsoc
                    print("$", attr['name'], " - An integer attribute\\cr", sep='')

        print("}")
    print("\\keyword{so_", name, "}", sep='')

# Generate C part of binding
os.chdir("../R/src")

for name in structure:
    if structure[name]['namespace'] == 'so':
        with open("gen-" + name + ".c", "w") as f:

            sys.stdout = f

            common.output_file = f
            common.print_license_string()
            print()
            print_includes()
            print()
            print_new(name)
            print()
            print_copy(name)
            print()
            print_free(name)
            print()
            print_ref_unref(name)
            print()

            if 'extends' in structure[name]:
                child = { 'name' : 'base', 'type' : structure[name]['extends'] }
                print_get_child(name, child)
コード例 #4
0
ファイル: R.py プロジェクト: rikardn/libsoc
                    print("$", attr['name'], " - An integer attribute\\cr", sep='')

        print("}")
    print("\\keyword{so_", name, "}", sep='')

# Generate C part of binding
os.chdir("../R/src")

for name in structure:
    if structure[name]['namespace'] == 'so':
        with open("gen-" + name + ".c", "w") as f:

            sys.stdout = f

            common.output_file = f
            common.print_license_string()
            print()
            print_includes()
            print()
            print_new(name)
            print()
            print_copy(name)
            print()
            print_free(name)
            print()
            print_ref_unref(name)
            print()

            if 'extends' in structure[name]:
                child = { 'name' : 'base', 'type' : structure[name]['extends'] }
                print_get_child(name, child)