From 32ef122e380a0d76b2cef5dae439f0b9b3aa35ee Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 12 Dec 2018 15:08:04 -0800 Subject: Deleted old Lua-based C API compiler. This compiler has been ported to C++, so the Lua compiler is no longer needed. --- tools/upbc.lua | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) (limited to 'tools/upbc.lua') diff --git a/tools/upbc.lua b/tools/upbc.lua index adea373..80d2886 100644 --- a/tools/upbc.lua +++ b/tools/upbc.lua @@ -9,7 +9,6 @@ --]] local dump_cinit = require "dump_cinit" -local make_c_api = require "make_c_api" local upb = require "upb" local generate_upbdefs = false @@ -77,40 +76,16 @@ for _, file in ipairs(files) do os.execute(string.format("mkdir -p `dirname %s`", outbase)) - if generate_upbdefs then - -- Legacy generated defs. - local hfile = open(hfilename) - local cfile = open(cfilename) + assert(generate_upbdefs) + -- Legacy generated defs. + local hfile = open(hfilename) + local cfile = open(cfilename) - local happend = dump_cinit.file_appender(hfile) - local cappend = dump_cinit.file_appender(cfile) + local happend = dump_cinit.file_appender(hfile) + local cappend = dump_cinit.file_appender(cfile) - dump_cinit.dump_defs(file, happend, cappend) + dump_cinit.dump_defs(file, happend, cappend) - hfile:close() - cfile:close() - else - -- Write C API. - hfilename = outbase .. ".upb.h" - cfilename = outbase .. ".upb.c" - - if os.getenv("UPBC_VERBOSE") then - print("upbc:") - print(string.format(" source file=%s", src)) - print(string.format(" output file base=%s", outbase)) - print(string.format(" hfilename=%s", hfilename)) - print(string.format(" cfilename=%s", cfilename)) - end - - local hfile = open(hfilename) - local cfile = open(cfilename) - - local happend = dump_cinit.file_appender(hfile) - local cappend = dump_cinit.file_appender(cfile) - - make_c_api.write_gencode(file, hfilename, happend, cappend) - - hfile:close() - cfile:close() - end + hfile:close() + cfile:close() end -- cgit v1.2.3