コード例 #1
0
ファイル: loxigen.py プロジェクト: macauleycheng/aos-loxigen
    enums = []
    for wire_version, ofinputs in ofinputs_by_version.items():
        version = OFVersions.from_wire(wire_version)
        ofprotocol = loxi_ir.build_protocol(version, ofinputs)
        loxi_globals.ir[version] = ofprotocol

    loxi_globals.unified = loxi_ir.build_unified_ir(loxi_globals.ir)

################################################################
#
# Debug
#
################################################################

if __name__ == '__main__':
    (options, args, target_versions) = cmdline.process_commandline()
    # @fixme Use command line params to select log

    logging.basicConfig(level = logging.INFO if not options.verbose else logging.DEBUG)

    # Import the language file
    lang_file = "lang_%s" % options.lang
    lang_module = __import__(lang_file)

    if hasattr(lang_module, "config_sanity_check") and not lang_module.config_sanity_check():
        debug("Config sanity check failed\n")
        sys.exit(1)

    # If list files, just list auto-gen files to stdout and exit
    if options.list_files:
        for name in lang_module.targets:
コード例 #2
0
    for wire_version, ofinputs in ofinputs_by_version.items():
        version = OFVersions.from_wire(wire_version)
        ofprotocol = loxi_ir.build_protocol(version, ofinputs)
        loxi_globals.ir[version] = ofprotocol

    loxi_globals.unified = loxi_ir.build_unified_ir(loxi_globals.ir)


################################################################
#
# Debug
#
################################################################

if __name__ == '__main__':
    (options, args, target_versions) = cmdline.process_commandline()
    # @fixme Use command line params to select log

    logging.basicConfig(
        level=logging.INFO if not options.verbose else logging.DEBUG)

    # Import the language file
    lang_file = "lang_%s" % options.lang
    lang_module = __import__(lang_file)

    log("\nGenerating files for target language %s\n" % options.lang)

    loxi_globals.OFVersions.target_versions = target_versions
    inputs = read_input()
    build_ir(inputs)
    lang_module.generate(options.install_dir)