From 72da577cbbe4642a58f908229a6c587d0eb77dde Mon Sep 17 00:00:00 2001 From: Mauro Iazzi Date: Wed, 11 Jun 2008 02:06:45 +0200 Subject: [PATCH] removed useless code --- generator/generator.lua | 138 ------------------------------------------------ 1 file changed, 138 deletions(-) diff --git a/generator/generator.lua b/generator/generator.lua index 7de316a..608237c 100644 --- a/generator/generator.lua +++ b/generator/generator.lua @@ -82,7 +82,6 @@ local print_head = fprint(assert(io.open(module_name..'_src/'..module_name..'_he local print_enum = fprint(assert(io.open(module_name..'_src/'..module_name..'_enum.cpp', 'w'))) local print_slot_h = fprint(assert(io.open(module_name..'_src/'..module_name..'_slot.hpp', 'w'))) local print_slot_c = fprint(assert(io.open(module_name..'_src/'..module_name..'_slot.cpp', 'w'))) -local print_type = fprint(assert(io.open(module_name..'_src/'..module_name..'_type.lua', 'w'))) local xmlstream, idindex = dofile(path..'xml.lua')(readfile(filename)) @@ -313,28 +312,6 @@ local fill_copy_constructor = function(index) return index end -local typesystem_enum_filler = function(enums) - local ret = {} - for e in pairs(enums) do - local en = e.xarg.fullname - table.insert(ret, [[ -types[']]..en..[['] = { - push = function(n) - return 'lqtL_pushenum(L, '..n..', "]]..en..[[")', 1 - end, - get = function(n) - return 'static_cast<]]..en..[[>' - ..'(lqtL_toenum(L, '..n..', "]]..en..[["))', 1 - end, - test = function(n) - return 'lqtL_isenum(L, '..n..', "]]..en..[[")', 1 - end, -} -]]) - end - return ret -end - local fill_typesystem_with_enums = function(enums, types) local etype = function(en) return { @@ -362,112 +339,6 @@ local fill_typesystem_with_enums = function(enums, types) return ret end -local typesystem_class_filler = function(classes) - local pointer_t = function(fn) - return [[ -types[']]..fn..[[*'] = { - -- the argument is a pointer to class - push = function(n) - return 'lqtL_passudata(L, '..n..', "]]..fn..[[*")', 1 - end, - get = function(n) - return 'static_cast<]]..fn..[[*>' - ..'(lqtL_toudata(L, '..n..', "]]..fn..[[*"))', 1 - end, - test = function(n) - return 'lqtL_isudata(L, '..n..', "]]..fn..[[*")', 1 - end, -} -]] - end - local pointer_const_t = function(fn) - return [[ -types[']]..fn..[[ const*'] = { - -- the argument is a pointer to constant class - push = function(n) - return 'lqtL_passudata(L, '..n..', "]]..fn..[[*")', 1 - end, - get = function(n) - return 'static_cast<]]..fn..[[*>' - ..'(lqtL_toudata(L, '..n..', "]]..fn..[[*"))', 1 - end, - test = function(n) - return 'lqtL_isudata(L, '..n..', "]]..fn..[[*")', 1 - end, -} -]] - end - local ref_t = function(fn) - return [[ -types[']]..fn..[[&'] = { - -- the argument is a reference to class - push = function(n) - return 'lqtL_passudata(L, &'..n..', "]]..fn..[[*")', 1 - end, - get = function(n) - return '*static_cast<]]..fn..[[*>' - ..'(lqtL_toudata(L, '..n..', "]]..fn..[[*"))', 1 - end, - test = function(n) - return 'lqtL_isudata(L, '..n..', "]]..fn..[[*")', 1 - end, -} -]] - end - local instance_t = function(fn, sn) - return [[ -types[']]..fn..[['] = { - -- the argument is a instance of class - push = function(n) - return 'lqtL_passudata(L, new ]]..sn - ..[[(L, '..n..'), "]]..fn..[[*")', 1 - end, - get = function(n) - return '*static_cast<]]..fn..[[*>' - ..'(lqtL_toudata(L, '..n..', "]]..fn..[[*"))', 1 - end, - test = function(n) - return 'lqtL_isudata(L, '..n..', "]]..fn..[[*")', 1 - end, -} -]] - end - local const_ref_t = function(fn, sn) - return [[ -types[']]..fn..[[ const&'] = { - -- the argument is a constant ref to class - push = function(n) - return 'lqtL_passudata(L, new ]]..sn - ..[[(L, '..n..'), "]]..fn..[[*")', 1 - end, - get = function(n) - return '*static_cast<]]..fn..[[*>' - ..'(lqtL_toudata(L, '..n..', "]]..fn..[[*"))', 1 - end, - test = function(n) - return 'lqtL_isudata(L, '..n..', "]]..fn..[[*")', 1 - end, -} -]] - end - local ret = {} - for c in pairs(classes) do - local ctype = '' - local shellname = 'lqt_shell_'..string.gsub(c.xarg.fullname, '::', '_LQT_') - ctype = ctype .. pointer_t(c.xarg.fullname) - ctype = ctype .. pointer_const_t(c.xarg.fullname) - ctype = ctype .. ref_t(c.xarg.fullname) - if c.public_constr and c.shell then - ctype = ctype .. instance_t(c.xarg.fullname, shellname) - ctype = ctype .. const_ref_t(c.xarg.fullname, shellname) - else - ctype = ctype .. 'types["'..c.xarg.fullname..'"] = false\n' - end - table.insert(ret, ctype) - end - return ret -end - local fill_typesystem_with_classes = function(classes, types) local pointer_t = function(fn) return { @@ -1126,15 +997,6 @@ print_enum('#include "'..module_name..'_head.hpp'..'"\n\n') print_slot_h('#include "'..module_name..'_head.hpp'..'"\n\n') print_slot_c('#include "'..module_name..'_slot.hpp'..'"\n\n') -print_type'local types = ... or {}\n' -for i, v in ipairs(typesystem_enum_filler(enums)) do - print_type(v) -end -for i, v in ipairs(typesystem_class_filler(classes)) do - print_type(v) -end -print_type'return types\n' - local classes = print_shell_classes(classes) -- does that local classes = print_virtual_overloads(classes, typesystem) -- does that local enums = print_enum_tables(enums) -- does that -- 2.11.4.GIT