def main(output, *filenames):
    # Load the scalars first.
    if len(filenames) > 1:
        raise Exception('We don\'t support loading from more than one file.')

    try:
        scalars = parse_scalars.load_scalars(filenames[0])
    except ParserError as ex:
        print("\nError processing scalars:\n" + str(ex) + "\n")
        sys.exit(1)

    # Write the enum file.
    print(banner, file=output)
    print(file_header, file=output)

    for s in scalars:
        cpp_guard = s.cpp_guard
        if cpp_guard:
            print("#if defined(%s)" % cpp_guard, file=output)
        print("  %s," % s.enum_label, file=output)
        if cpp_guard:
            print("#endif", file=output)

    print("  ScalarCount,", file=output)

    print(file_footer, file=output)
Beispiel #2
0
def parse_scalar_definitions(filenames):
    if len(filenames) > 1:
        raise Exception('We don\'t support loading from more than one file.')

    try:
        return parse_scalars.load_scalars(filenames[0])
    except ParserError as ex:
        print("\nError processing scalars:\n" + str(ex) + "\n")
        sys.exit(1)
Beispiel #3
0
def parse_scalar_definitions(filenames):
    if len(filenames) > 1:
        raise Exception('We don\'t support loading from more than one file.')

    try:
        return parse_scalars.load_scalars(filenames[0])
    except ParserError as ex:
        print("\nError processing scalars:\n" + str(ex) + "\n")
        sys.exit(1)
Beispiel #4
0
def main(output, *filenames):
    # Load the scalars first.
    if len(filenames) > 1:
        raise Exception("We don't support loading from more than one file.")
    scalars = parse_scalars.load_scalars(filenames[0])

    # Write the scalar data file.
    print(banner, file=output)
    print(file_header, file=output)
    write_scalar_tables(scalars, output)
    print(file_footer, file=output)
def main(output, *filenames):
    # Load the scalars first.
    if len(filenames) > 1:
        raise Exception('We don\'t support loading from more than one file.')
    scalars = parse_scalars.load_scalars(filenames[0])

    # Write the scalar data file.
    print(banner, file=output)
    print(file_header, file=output)
    write_scalar_tables(scalars, output)
    print(file_footer, file=output)
def main(output, *filenames):
    # Load the scalars first.
    if len(filenames) > 1:
        raise Exception('We don\'t support loading from more than one file.')

    try:
        scalars = parse_scalars.load_scalars(filenames[0])
    except ParserError as ex:
        print("\nError processing scalars:\n" + str(ex) + "\n")
        sys.exit(1)

    # Write the scalar data file.
    print(banner, file=output)
    print(file_header, file=output)
    write_scalar_tables(scalars, output)
    print(file_footer, file=output)
Beispiel #7
0
def main(output, *filenames):
    # Load the scalars first.
    if len(filenames) > 1:
        raise Exception('We don\'t support loading from more than one file.')

    try:
        scalars = parse_scalars.load_scalars(filenames[0])
    except ParserError as ex:
        print("\nError processing scalars:\n" + str(ex) + "\n")
        sys.exit(1)

    # Write the scalar data file.
    print(banner, file=output)
    print(file_header, file=output)
    write_scalar_tables(scalars, output)
    print(file_footer, file=output)
def main(output, *filenames):
    # Load the scalars first.
    if len(filenames) > 1:
        raise Exception('We don\'t support loading from more than one file.')
    scalars = parse_scalars.load_scalars(filenames[0])

    # Write the enum file.
    print(banner, file=output)
    print(file_header, file=output);

    for s in scalars:
        cpp_guard = s.cpp_guard
        if cpp_guard:
            print("#if defined(%s)" % cpp_guard, file=output)
        print("  %s," % s.enum_label, file=output)
        if cpp_guard:
            print("#endif", file=output)

    print("  ScalarCount,", file=output)

    print(file_footer, file=output)