diff options
author | chai <chaifix@163.com> | 2021-11-08 10:53:42 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-08 10:53:42 +0800 |
commit | 5f46b4102c179680d613b6b9e0e6d392318030d2 (patch) | |
tree | 16527828dc89133f7af41acf6f5c13c23743e7ef /ThirdParty/tolua-5.2.4/src/bin/lua-5.0/doit.lua | |
parent | 138d3f4d3d6e2aaf5ba34f89af15ef85ea074357 (diff) |
+ tolua
Diffstat (limited to 'ThirdParty/tolua-5.2.4/src/bin/lua-5.0/doit.lua')
-rw-r--r-- | ThirdParty/tolua-5.2.4/src/bin/lua-5.0/doit.lua | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/ThirdParty/tolua-5.2.4/src/bin/lua-5.0/doit.lua b/ThirdParty/tolua-5.2.4/src/bin/lua-5.0/doit.lua new file mode 100644 index 0000000..b6f88d7 --- /dev/null +++ b/ThirdParty/tolua-5.2.4/src/bin/lua-5.0/doit.lua @@ -0,0 +1,63 @@ +-- Generate binding code +-- Written by Waldemar Celes +-- TeCGraf/PUC-Rio +-- Jul 1998 +-- Last update: Apr 2003 +-- $Id: doit.lua,v 1.1 2009-07-09 13:43:59 fabraham Exp $ + + +-- This code is free software; you can redistribute it and/or modify it. +-- The software provided hereunder is on an "as is" basis, and +-- the author has no obligation to provide maintenance, support, updates, +-- enhancements, or modifications. + +function doit () + -- define package name, if not provided + if not flags.n then + if flags.f then + flags.n = gsub(flags.f,"%..*","") + else + error("#no package name nor input file provided") + end + end + + -- proccess package + local p = Package(flags.n,flags.f) + + if flags.p then + return -- only parse + end + + if flags.o then + local st,msg = writeto(flags.o) + if not st then + error('#'..msg) + end + end + + p:decltype() + if flags.P then + p:print() + else + p:preamble() + p:supcode() + p:register() + end + + if flags.o then + writeto() + end + + -- write header file + if not flags.P then + if flags.H then + local st,msg = writeto(flags.H) + if not st then + error('#'..msg) + end + p:header() + writeto() + end + end +end + |