|
@@ -27,94 +27,7 @@
|
|
|
"interpreters" file with the filename (excluding it's lua extension) into the
|
|
"interpreters" file with the filename (excluding it's lua extension) into the
|
|
|
"api" table variable. ]]--
|
|
"api" table variable. ]]--
|
|
|
|
|
|
|
|
-local classes = {}
|
|
|
|
|
-local enumerates = {}
|
|
|
|
|
-local globalConstants = {}
|
|
|
|
|
-local globalFunctions = {}
|
|
|
|
|
-local globalProperties = {}
|
|
|
|
|
-local currentClass = nil
|
|
|
|
|
-local currentFunction = nil
|
|
|
|
|
-
|
|
|
|
|
-function classClass:print(ident,close)
|
|
|
|
|
- local class = {}
|
|
|
|
|
- class.name = self.name
|
|
|
|
|
- class.base = self.base
|
|
|
|
|
- class.lname = self.lname
|
|
|
|
|
- class.type = self.type
|
|
|
|
|
- class.btype = self.btype
|
|
|
|
|
- class.ctype = self.ctype
|
|
|
|
|
-
|
|
|
|
|
- currentClass = class
|
|
|
|
|
- local i = 1
|
|
|
|
|
- while self[i] do
|
|
|
|
|
- self[i]:print(ident.." ",",")
|
|
|
|
|
- i = i + 1
|
|
|
|
|
- end
|
|
|
|
|
- currentClass = nil
|
|
|
|
|
-
|
|
|
|
|
- table.insert(classes, class)
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-function classCode:print(ident,close)
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-function classDeclaration:print(ident,close)
|
|
|
|
|
- local declaration = {}
|
|
|
|
|
- declaration.mod = self.mod
|
|
|
|
|
- declaration.type = self.type
|
|
|
|
|
- declaration.ptr = self.ptr
|
|
|
|
|
- declaration.name = self.name
|
|
|
|
|
- declaration.dim = self.dim
|
|
|
|
|
- declaration.def = self.def
|
|
|
|
|
- declaration.ret = self.ret
|
|
|
|
|
-
|
|
|
|
|
- if currentFunction ~= nil then
|
|
|
|
|
- if currentFunction.declarations == nil then
|
|
|
|
|
- currentFunction.declarations = { declaration }
|
|
|
|
|
- else
|
|
|
|
|
- table.insert(currentFunction.declarations, declaration)
|
|
|
|
|
- end
|
|
|
|
|
- end
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-function classEnumerate:print(ident,close)
|
|
|
|
|
- local enumerate = {}
|
|
|
|
|
- enumerate.name = self.name
|
|
|
|
|
-
|
|
|
|
|
- local i = 1
|
|
|
|
|
- while self[i] do
|
|
|
|
|
- if self[i] ~= "" then
|
|
|
|
|
- if enumerate.values == nil then
|
|
|
|
|
- enumerate.values = { self[i] }
|
|
|
|
|
- else
|
|
|
|
|
- table.insert(enumerate.values, self[i])
|
|
|
|
|
- end
|
|
|
|
|
- end
|
|
|
|
|
- i = i + 1
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- if enumerate.values ~= nil then
|
|
|
|
|
- table.insert(enumerates, enumerate)
|
|
|
|
|
- end
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-function deepCopy(t)
|
|
|
|
|
- if type(t) ~= "table" then
|
|
|
|
|
- return t
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- local mt = getmetatable(t)
|
|
|
|
|
- local ret = {}
|
|
|
|
|
- for k, v in pairs(t) do
|
|
|
|
|
- if type(v) == "table" then
|
|
|
|
|
- v = deepCopy(v)
|
|
|
|
|
- end
|
|
|
|
|
- ret[k] = v
|
|
|
|
|
- end
|
|
|
|
|
- setmetatable(ret, mt)
|
|
|
|
|
-
|
|
|
|
|
- return ret
|
|
|
|
|
-end
|
|
|
|
|
|
|
+require "ToDoxHook"
|
|
|
|
|
|
|
|
function printFunction(self,ident,close,isfunc)
|
|
function printFunction(self,ident,close,isfunc)
|
|
|
local func = {}
|
|
local func = {}
|
|
@@ -154,44 +67,6 @@ function printFunction(self,ident,close,isfunc)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-function classFunction:print(ident,close)
|
|
|
|
|
- printFunction(self,ident,close, true)
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-function classOperator:print(ident,close)
|
|
|
|
|
- printFunction(self,ident,close, false)
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-function classVariable:print(ident,close)
|
|
|
|
|
- local property = {}
|
|
|
|
|
- property.mod = self.mod
|
|
|
|
|
- property.type = self.type
|
|
|
|
|
- property.ptr = self.ptr
|
|
|
|
|
- property.name = self.lname
|
|
|
|
|
- property.def = self.def
|
|
|
|
|
- property.ret = self.ret
|
|
|
|
|
-
|
|
|
|
|
- if currentClass == nil then
|
|
|
|
|
- if property.mod:find("tolua_property__") == nil then
|
|
|
|
|
- table.insert(globalConstants, property)
|
|
|
|
|
- else
|
|
|
|
|
- table.insert(globalProperties, property)
|
|
|
|
|
- end
|
|
|
|
|
- else
|
|
|
|
|
- if currentClass.properties == nil then
|
|
|
|
|
- currentClass.properties = { property }
|
|
|
|
|
- else
|
|
|
|
|
- table.insert(currentClass.properties, property)
|
|
|
|
|
- end
|
|
|
|
|
- end
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-function classVerbatim:print(ident,close)
|
|
|
|
|
-end
|
|
|
|
|
-
|
|
|
|
|
-function sortByName(t)
|
|
|
|
|
- table.sort(t, function(a, b) return a.name < b.name end)
|
|
|
|
|
-end
|
|
|
|
|
|
|
|
|
|
-- Workaround for Zerobrane Studio's tool-tip with overloaded functions
|
|
-- Workaround for Zerobrane Studio's tool-tip with overloaded functions
|
|
|
function adjustClassesOverloadFuncs()
|
|
function adjustClassesOverloadFuncs()
|