int eolian_object_line_get(const Eolian_Object *obj);
int eolian_object_column_get(const Eolian_Object *obj);
const char *eolian_object_name_get(const Eolian_Object *obj);
+ const char *eolian_object_short_name_get(const Eolian_Object *obj);
+ Eina_Iterator *eolian_object_namespaces_get(const Eolian_Object *obj);
Eina_Bool eolian_state_directory_add(Eolian_State *state, const char *dir);
Eina_Bool eolian_state_system_directory_add(Eolian_State *state);
Eina_Iterator *eolian_state_eo_file_paths_get(const Eolian_State *state);
Eina_Iterator *eolian_unit_structs_get(const Eolian_Unit *unit);
Eina_Iterator *eolian_unit_enums_get(const Eolian_Unit *unit);
- const char *eolian_class_full_name_get(const Eolian_Class *klass);
- const char *eolian_class_name_get(const Eolian_Class *klass);
- Eina_Iterator *eolian_class_namespaces_get(const Eolian_Class *klass);
Eolian_Class_Type eolian_class_type_get(const Eolian_Class *klass);
const Eolian_Documentation *eolian_class_documentation_get(const Eolian_Class *klass);
const char *eolian_class_legacy_prefix_get(const Eolian_Class *klass);
Eina_Iterator *eolian_class_functions_get(const Eolian_Class *klass, Eolian_Function_Type func_type);
Eolian_Function_Type eolian_function_type_get(const Eolian_Function *function_id);
Eolian_Object_Scope eolian_function_scope_get(const Eolian_Function *function_id, Eolian_Function_Type ftype);
- const char *eolian_function_name_get(const Eolian_Function *function_id);
const char *eolian_function_full_c_name_get(const Eolian_Function *function_id, Eolian_Function_Type ftype, Eina_Bool use_legacy);
const Eolian_Function *eolian_class_function_get_by_name(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
const char *eolian_function_legacy_get(const Eolian_Function *function_id, Eolian_Function_Type f_type);
Eolian_Parameter_Dir eolian_parameter_direction_get(const Eolian_Function_Parameter *param);
const Eolian_Type *eolian_parameter_type_get(const Eolian_Function_Parameter *param);
const Eolian_Expression *eolian_parameter_default_value_get(const Eolian_Function_Parameter *param);
- const char *eolian_parameter_name_get(const Eolian_Function_Parameter *param);
const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian_Function_Parameter *param);
Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc);
Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc);
const Eolian_Documentation *eolian_function_return_documentation_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
Eina_Bool eolian_function_return_is_warn_unused(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
Eina_Bool eolian_function_object_is_const(const Eolian_Function *function_id);
- const char *eolian_implement_full_name_get(const Eolian_Implement *impl);
const Eolian_Class *eolian_implement_class_get(const Eolian_Implement *impl);
const Eolian_Function *eolian_implement_function_get(const Eolian_Implement *impl, Eolian_Function_Type *func_type);
const Eolian_Documentation *eolian_implement_documentation_get(const Eolian_Implement *impl, Eolian_Function_Type f_type);
Eina_Bool eolian_implement_is_prop_get(const Eolian_Implement *impl);
Eina_Bool eolian_implement_is_prop_set(const Eolian_Implement *impl);
Eina_Iterator *eolian_class_implements_get(const Eolian_Class *klass);
- const char *eolian_constructor_full_name_get(const Eolian_Constructor *ctor);
const Eolian_Class *eolian_constructor_class_get(const Eolian_Constructor *ctor);
const Eolian_Function *eolian_constructor_function_get(const Eolian_Constructor *ctor);
Eina_Bool eolian_constructor_is_optional(const Eolian_Constructor *ctor);
Eina_Iterator *eolian_class_constructors_get(const Eolian_Class *klass);
Eina_Iterator *eolian_class_events_get(const Eolian_Class *klass);
- const char *eolian_event_name_get(const Eolian_Event *event);
const Eolian_Type *eolian_event_type_get(const Eolian_Event *event);
const Eolian_Documentation *eolian_event_documentation_get(const Eolian_Event *event);
Eolian_Object_Scope eolian_event_scope_get(const Eolian_Event *event);
Eolian_Typedecl_Type eolian_typedecl_type_get(const Eolian_Typedecl *tp);
Eina_Iterator *eolian_typedecl_struct_fields_get(const Eolian_Typedecl *tp);
const Eolian_Struct_Type_Field *eolian_typedecl_struct_field_get(const Eolian_Typedecl *tp, const char *field);
- const char *eolian_typedecl_struct_field_name_get(const Eolian_Struct_Type_Field *fl);
const Eolian_Documentation *eolian_typedecl_struct_field_documentation_get(const Eolian_Struct_Type_Field *fl);
const Eolian_Type *eolian_typedecl_struct_field_type_get(const Eolian_Struct_Type_Field *fl);
Eina_Iterator *eolian_typedecl_enum_fields_get(const Eolian_Typedecl *tp);
const Eolian_Enum_Type_Field *eolian_typedecl_enum_field_get(const Eolian_Typedecl *tp, const char *field);
- const char *eolian_typedecl_enum_field_name_get(const Eolian_Enum_Type_Field *fl);
const char *eolian_typedecl_enum_field_c_name_get(const Eolian_Enum_Type_Field *fl);
const Eolian_Documentation *eolian_typedecl_enum_field_documentation_get(const Eolian_Enum_Type_Field *fl);
const Eolian_Expression *eolian_typedecl_enum_field_value_get(const Eolian_Enum_Type_Field *fl, Eina_Bool force);
const char *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype);
const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
- const char *eolian_type_name_get(const Eolian_Type *tp);
- const char *eolian_typedecl_name_get(const Eolian_Typedecl *tp);
-
- const char *eolian_type_full_name_get(const Eolian_Type *tp);
- const char *eolian_typedecl_full_name_get(const Eolian_Typedecl *tp);
-
- Eina_Iterator *eolian_type_namespaces_get(const Eolian_Type *tp);
- Eina_Iterator *eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp);
-
const char *eolian_type_free_func_get(const Eolian_Type *tp);
const char *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp);
const Eolian_Documentation *eolian_variable_documentation_get(const Eolian_Variable *var);
const Eolian_Type *eolian_variable_base_type_get(const Eolian_Variable *var);
const Eolian_Expression *eolian_variable_value_get(const Eolian_Variable *var);
- const char *eolian_variable_name_get(const Eolian_Variable *var);
- const char *eolian_variable_full_name_get(const Eolian_Variable *var);
- Eina_Iterator *eolian_variable_namespaces_get(const Eolian_Variable *var);
Eina_Bool eolian_variable_is_extern(const Eolian_Variable *var);
const char *eolian_documentation_summary_get(const Eolian_Documentation *doc);
const char *eolian_documentation_description_get(const Eolian_Documentation *doc);
return nil
end
return ffi.string(v)
+ end,
+
+ short_name_get = function(self)
+ local v = eolian.eolian_object_short_name_get(cast_obj(self))
+ if v == nil then
+ return nil
+ end
+ return ffi.string(v)
+ end,
+
+ namespaces_get = function(self)
+ return iterator.String_Iterator(
+ eolian.eolian_object_namespaces_get(cast_obj(self)))
end
}
ffi.metatype("Eolian_Object", { __index = object_idx })
ffi.metatype("Eolian_Struct_Type_Field", {
__index = wrap_object {
- name_get = function(self)
- local v = eolian.eolian_typedecl_struct_field_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
documentation_get = function(self)
local v = eolian.eolian_typedecl_struct_field_documentation_get(self)
if v == nil then return nil end
ffi.metatype("Eolian_Enum_Type_Field", {
__index = wrap_object {
- name_get = function(self)
- local v = eolian.eolian_typedecl_enum_field_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
c_name_get = function(self)
local v = eolian.eolian_typedecl_enum_field_c_name_get(self)
if v == nil then return nil end
return ffi_stringshare(v)
end,
- name_get = function(self)
- local v = eolian.eolian_typedecl_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- full_name_get = function(self)
- local v = eolian.eolian_typedecl_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- namespaces_get = function(self)
- return iterator.String_Iterator(
- eolian.eolian_typedecl_namespaces_get(self))
- end,
-
free_func_get = function(self)
local v = eolian.eolian_typedecl_free_func_get(self)
if v == nil then return nil end
return ffi_stringshare(v)
end,
- name_get = function(self)
- local v = eolian.eolian_type_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- full_name_get = function(self)
- local v = eolian.eolian_type_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- namespaces_get = function(self)
- return iterator.String_Iterator(
- eolian.eolian_type_namespaces_get(self))
- end,
-
free_func_get = function(self)
local v = eolian.eolian_type_free_func_get(self)
if v == nil then return nil end
return tonumber(eolian.eolian_function_scope_get(self, ftype))
end,
- name_get = function(self)
- local v = eolian.eolian_function_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
full_c_name_get = function(self, ftype, use_legacy)
local v = eolian.eolian_function_full_c_name_get(self, ftype, use_legacy or false)
if v == nil then return nil end
return v
end,
- name_get = function(self)
- local v = eolian.eolian_parameter_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
documentation_get = function(self)
local v = eolian.eolian_parameter_documentation_get(self)
if v == nil then return nil end
ffi.metatype("Eolian_Implement", {
__index = wrap_object {
- full_name_get = function(self)
- local v = eolian.eolian_implement_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
class_get = function(self)
local v = eolian.eolian_implement_class_get(self)
if v == nil then return nil end
ffi.metatype("Eolian_Constructor", {
__index = wrap_object {
- full_name_get = function(self)
- local v = eolian.eolian_constructor_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
class_get = function(self)
local v = eolian.eolian_constructor_class_get(self)
if v == nil then return nil end
ffi.metatype("Eolian_Event", {
__index = wrap_object {
- name_get = function(self)
- local v = eolian.eolian_event_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
type_get = function(self)
local v = eolian.eolian_event_type_get(self)
if v == nil then return nil end
M.Class = ffi.metatype("Eolian_Class", {
__index = wrap_object {
- full_name_get = function(self)
- local v = eolian.eolian_class_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- name_get = function(self)
- local v = eolian.eolian_class_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- namespaces_get = function(self)
- return iterator.String_Iterator(
- eolian.eolian_class_namespaces_get(self))
- end,
-
type_get = function(self)
return tonumber(eolian.eolian_class_type_get(self))
end,
local v = eolian.eolian_class_eo_prefix_get(self)
if v == nil then
local buf = self:namespaces_get()
- buf[#buf + 1] = self:name_get()
+ buf[#buf + 1] = self:short_name_get()
return table.concat(buf, "_"):lower()
end
return ffi.string(v)
return v
end,
- name_get = function(self)
- local v = eolian.eolian_variable_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- full_name_get = function(self)
- local v = eolian.eolian_variable_full_name_get(self)
- if v == nil then return nil end
- return ffi.string(v)
- end,
-
- namespaces_get = function(self)
- return iterator.String_Iterator(
- eolian.eolian_variable_namespaces_get(self))
- end,
-
is_extern = function(self)
return eolian.eolian_variable_is_extern(self) ~= 0
end
PROTECTED = eolian.object_scope.PROTECTED
},
+ __ctor = function(self, obj)
+ self._obj = obj
+ assert(self._obj)
+ end,
+
+ name_get = function(self)
+ return self.obj:name_get()
+ end,
+
+ short_name_get = function(self)
+ return self.obj:short_name_get()
+ end,
+
+ namespaces_get = function(self)
+ return self._obj:namespaces_get():to_array()
+ end,
+
nspaces_get = function(self, root)
local tbl = self:namespaces_get()
-- temporary workaround
tbl[i] = tbl[i]:lower()
end
- tbl[#tbl + 1] = self:name_get():lower()
+ tbl[#tbl + 1] = self:short_name_get():lower()
if root ~= nil then
tbl[#tbl + 1] = not not root
end
end
M.Doc = Node:clone {
- __ctor = function(self, doc)
- self.doc = doc
- end,
-
summary_get = function(self)
- if not self.doc then
+ if not self._obj then
return nil
end
- return self.doc:summary_get()
+ return self._obj:summary_get()
end,
description_get = function(self)
- if not self.doc then
+ if not self._obj then
return nil
end
- return self.doc:description_get()
+ return self._obj:description_get()
end,
since_get = function(self)
- if not self.doc then
+ if not self._obj then
return nil
end
- return self.doc:since_get()
+ return self._obj:since_get()
end,
brief_get = function(self, doc2)
- if not self.doc and (not doc2 or not doc2.doc) then
+ if not self._obj and (not doc2 or not doc2._obj) then
return "No description supplied."
end
- local doc1, doc2 = self.doc, doc2 and doc2.doc or nil
+ local doc1, doc2 = self._obj, doc2 and doc2._obj or nil
if not doc1 then
doc1, doc2 = doc2, doc1
end
end,
full_get = function(self, doc2, write_since)
- if not self.doc and (not doc2 or not doc2.doc) then
+ if not self._obj and (not doc2 or not doc2._obj) then
return "No description supplied."
end
- local doc1, doc2 = self.doc, doc2 and doc2.doc or nil
+ local doc1, doc2 = self._obj, doc2 and doc2._obj or nil
if not doc1 then
doc1, doc2 = doc2, doc1
end
end,
exists = function(self)
- return not not self.doc
+ return not not self._obj
end
}
MIXIN = eolian.class_type.MIXIN,
INTERFACE = eolian.class_type.INTERFACE,
- __ctor = function(self, cl)
- self.class = cl
- assert(self.class)
- end,
-
- full_name_get = function(self)
- return self.class:full_name_get()
- end,
-
- name_get = function(self)
- return self.class:name_get()
- end,
-
- namespaces_get = function(self)
- return self.class:namespaces_get():to_array()
- end,
-
type_get = function(self)
- return self.class:type_get()
+ return self._obj:type_get()
end,
type_str_get = function(self)
end,
doc_get = function(self)
- return M.Doc(self.class:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
legacy_prefix_get = function(self)
- return self.class:legacy_prefix_get()
+ return self._obj:legacy_prefix_get()
end,
eo_prefix_get = function(self)
- return self.class:eo_prefix_get()
+ return self._obj:eo_prefix_get()
end,
inherits_get = function(self)
return ret
end
ret = {}
- for cl in self.class:inherits_get() do
+ for cl in self._obj:inherits_get() do
ret[#ret + 1] = M.Class(cl)
end
self._cache_inhc = ret
end,
children_get = function(self)
- return revh[self:full_name_get()] or {}
+ return revh[self:name_get()] or {}
end,
functions_get = function(self, ft)
end
ret = {}
self._cache_funcs = ret
- for fn in self.class:functions_get(ft) do
+ for fn in self._obj:functions_get(ft) do
ret[#ret + 1] = M.Function(fn)
end
return ret
if fun then
return fun
end
- fun = M.Function(self.class:function_get_by_name(fn, ft))
+ fun = M.Function(self._obj:function_get_by_name(fn, ft))
self._cache_func = fun
return fun
end,
events_get = function(self)
local ret = {}
- for ev in self.class:events_get() do
+ for ev in self._obj:events_get() do
ret[#ret + 1] = M.Event(ev)
end
return ret
implements_get = function(self)
local ret = {}
- for impl in self.class:implements_get() do
+ for impl in self._obj:implements_get() do
ret[#ret + 1] = M.Implement(impl)
end
return ret
end,
c_get_function_name_get = function(self)
- return self.class:c_get_function_name_get()
+ return self._obj:c_get_function_name_get()
end,
nspaces_get = function(self, root)
end,
is_same = function(self, other)
- return self.class == other.class
+ return self._obj == other._obj
end,
-- static getters
METHOD = eolian.function_type.METHOD,
FUNCTION_POINTER = eolian.function_type.FUNCTION_POINTER,
- __ctor = function(self, fn)
- self.func = fn
- assert(self.func)
- end,
-
- name_get = function(self)
- return self.func:name_get()
- end,
-
type_get = function(self)
- return self.func:type_get()
+ return self._obj:type_get()
end,
type_str_get = function(self)
end,
scope_get = function(self, ft)
- return self.func:scope_get(ft)
+ return self._obj:scope_get(ft)
end,
full_c_name_get = function(self, ft, legacy)
- return self.func:full_c_name_get(ft, legacy)
+ return self._obj:full_c_name_get(ft, legacy)
end,
legacy_get = function(self, ft)
- return self.func:legacy_get(ft)
+ return self._obj:legacy_get(ft)
end,
implement_get = function(self)
- return M.Implement(self.func:implement_get())
+ return M.Implement(self._obj:implement_get())
end,
is_legacy_only = function(self, ft)
- return self.func:is_legacy_only(ft)
+ return self._obj:is_legacy_only(ft)
end,
is_class = function(self)
- return self.func:is_class()
+ return self._obj:is_class()
end,
is_beta = function(self)
- return self.func:is_beta()
+ return self._obj:is_beta()
end,
is_constructor = function(self, klass)
- return self.func:is_constructor(klass.class)
+ return self._obj:is_constructor(klass.class)
end,
is_function_pointer = function(self)
- return self.func:is_function_pointer()
+ return self._obj:is_function_pointer()
end,
property_keys_get = function(self, ft)
local ret = {}
- for par in self.func:property_keys_get(ft) do
+ for par in self._obj:property_keys_get(ft) do
ret[#ret + 1] = M.Parameter(par)
end
return ret
property_values_get = function(self, ft)
local ret = {}
- for par in self.func:property_values_get(ft) do
+ for par in self._obj:property_values_get(ft) do
ret[#ret + 1] = M.Parameter(par)
end
return ret
parameters_get = function(self)
local ret = {}
- for par in self.func:parameters_get() do
+ for par in self._obj:parameters_get() do
ret[#ret + 1] = M.Parameter(par)
end
return ret
end,
return_type_get = function(self, ft)
- local v = self.func:return_type_get(ft)
+ local v = self._obj:return_type_get(ft)
if not v then
return nil
end
end,
return_default_value_get = function(self, ft)
- local v = self.func:return_default_value_get(ft)
+ local v = self._obj:return_default_value_get(ft)
if not v then
return nil
end
end,
return_doc_get = function(self, ft)
- return M.Doc(self.func:return_documentation_get(ft))
+ return M.Doc(self._obj:return_documentation_get(ft))
end,
return_is_warn_unused = function(self, ft)
- return self.func:return_is_warn_unused(ft)
+ return self._obj:return_is_warn_unused(ft)
end,
is_const = function(self)
- return self.func:is_const()
+ return self._obj:is_const()
end,
nspaces_get = function(self, cl, root)
end,
is_same = function(self, other)
- return self.func == other.func
+ return self._obj == other._obj
end,
id_get = function(self)
- return tonumber(ffi.cast("uintptr_t", self.func))
+ return tonumber(ffi.cast("uintptr_t", self._obj))
end
}
OUT = eolian.parameter_dir.OUT,
INOUT = eolian.parameter_dir.INOUT,
- __ctor = function(self, par)
- self.param = par
- assert(self.param)
- end,
-
direction_get = function(self)
- return self.param:direction_get()
+ return self._obj:direction_get()
end,
direction_name_get = function(self)
end,
type_get = function(self)
- local v = self.param:type_get()
+ local v = self._obj:type_get()
if not v then
return nil
end
end,
default_value_get = function(self)
- local v = self.param:default_value_get()
+ local v = self._obj:default_value_get()
if not v then
return nil
end
return M.Expression(v)
end,
- name_get = function(self)
- return self.param:name_get()
- end,
-
doc_get = function(self)
- return M.Doc(self.param:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
is_nonull = function(self)
- return self.param:is_nonull()
+ return self._obj:is_nonull()
end,
is_nullable = function(self)
- return self.param:is_nullable()
+ return self._obj:is_nullable()
end,
is_optional = function(self)
- return self.param:is_optional()
+ return self._obj:is_optional()
end,
is_same = function(self, other)
- return self.param == other.param
+ return self._obj == other._obj
end
}
M.Event = Node:clone {
- __ctor = function(self, ev)
- self.event = ev
- assert(self.event)
- end,
-
- name_get = function(self)
- return self.event:name_get()
- end,
-
type_get = function(self)
- local v = self.event:type_get()
+ local v = self._obj:type_get()
if not v then
return nil
end
end,
doc_get = function(self)
- return M.Doc(self.event:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
scope_get = function(self)
- return self.event:scope_get()
+ return self._obj:scope_get()
end,
c_name_get = function(self)
- return self.event:c_name_get()
+ return self._obj:c_name_get()
end,
is_beta = function(self)
- return self.event:is_beta()
+ return self._obj:is_beta()
end,
is_hot = function(self)
- return self.event:is_hot()
+ return self._obj:is_hot()
end,
is_restart = function(self)
- return self.event:is_restart()
+ return self._obj:is_restart()
end,
nspaces_get = function(self, cl, root)
}
M.StructField = Node:clone {
- __ctor = function(self, fl)
- self.field = fl
- assert(self.field)
- end,
-
- name_get = function(self)
- return self.field:name_get()
- end,
-
doc_get = function(self)
- return M.Doc(self.field:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
type_get = function(self)
- local v = self.field:type_get()
+ local v = self._obj:type_get()
if not v then
return nil
end
}
M.EnumField = Node:clone {
- __ctor = function(self, fl)
- self.field = fl
- assert(self.field)
- end,
-
- name_get = function(self)
- return self.field:name_get()
- end,
-
c_name_get = function(self)
- return self.field:c_name_get()
+ return self._obj:c_name_get()
end,
doc_get = function(self)
- return M.Doc(self.field:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
value_get = function(self, force)
- local v = self.field:value_get(force)
+ local v = self._obj:value_get(force)
if not v then
return nil
end
CLASS = eolian.type_type.CLASS,
UNDEFINED = eolian.type_type.UNDEFINED,
- __ctor = function(self, tp)
- self.type = tp
- assert(self.type)
- end,
-
type_get = function(self)
- return self.type:type_get()
+ return self._obj:type_get()
end,
file_get = function(self)
- return self.type:file_get()
+ return self._obj:file_get()
end,
base_type_get = function(self)
- local v = self.type:base_type_get()
+ local v = self._obj:base_type_get()
if not v then
return nil
end
end,
next_type_get = function(self)
- local v = self.type:next_type_get()
+ local v = self._obj:next_type_get()
if not v then
return nil
end
end,
typedecl_get = function(self)
- local v = self.type:typedecl_get()
+ local v = self._obj:typedecl_get()
if not v then
return nil
end
end,
aliased_base_get = function(self)
- local v = self.type:aliased_base_get()
+ local v = self._obj:aliased_base_get()
if not v then
return nil
end
class_get = function(self)
-- FIXME: unit
- return self.type:class_get(eos:unit_get())
+ return self._obj:class_get(eos:unit_get())
end,
is_owned = function(self)
- return self.type:is_owned()
+ return self._obj:is_owned()
end,
is_const = function(self)
- return self.type:is_const()
+ return self._obj:is_const()
end,
is_ptr = function(self)
- return self.type:is_ptr()
+ return self._obj:is_ptr()
end,
c_type_get = function(self)
- return self.type:c_type_get(eolian.c_type_type.DEFAULT)
- end,
-
- name_get = function(self)
- return self.type:name_get()
- end,
-
- full_name_get = function(self)
- return self.type:full_name_get()
- end,
-
- namespaces_get = function(self)
- return self.type:namespaces_get()
+ return self._obj:c_type_get(eolian.c_type_type.DEFAULT)
end,
free_func_get = function(self)
- return self.type:free_func_get()
+ return self._obj:free_func_get()
end,
-- utils
serialize = function(self)
local tpt = self:type_get()
if tpt == self.UNKNOWN then
- error("unknown type: " .. self:full_name_get())
+ error("unknown type: " .. self:name_get())
elseif tpt == self.VOID then
return wrap_type_attrs(self, "void")
elseif tpt == self.UNDEFINED then
stypes[#stypes + 1] = stp:serialize()
stp = stp:next_type_get()
end
- return wrap_type_attrs(self, self:full_name_get() .. "<"
+ return wrap_type_attrs(self, self:name_get() .. "<"
.. table.concat(stypes, ", ") .. ">")
end
- return wrap_type_attrs(self, self:full_name_get())
+ return wrap_type_attrs(self, self:name_get())
end
error("unhandled type type: " .. tpt)
end
ALIAS = eolian.typedecl_type.ALIAS,
FUNCTION_POINTER = eolian.typedecl_type.FUNCTION_POINTER,
- __ctor = function(self, tp)
- self.typedecl = tp
- assert(self.typedecl)
- end,
-
type_get = function(self)
- return self.typedecl:type_get()
+ return self._obj:type_get()
end,
type_str_get = function(self)
struct_fields_get = function(self)
local ret = {}
- for fl in self.typedecl:struct_fields_get() do
+ for fl in self._obj:struct_fields_get() do
ret[#ret + 1] = M.StructField(fl)
end
return ret
end,
struct_field_get = function(self, name)
- local v = self.typedecl:struct_field_get(name)
+ local v = self._obj:struct_field_get(name)
if not v then
return nil
end
enum_fields_get = function(self)
local ret = {}
- for fl in self.typedecl:enum_fields_get() do
+ for fl in self._obj:enum_fields_get() do
ret[#ret + 1] = M.EnumField(fl)
end
return ret
end,
enum_field_get = function(self, name)
- local v = self.typedecl:enum_field_get(name)
+ local v = self._obj:enum_field_get(name)
if not v then
return nil
end
end,
enum_legacy_prefix_get = function(self)
- return self.typedecl:enum_legacy_prefix_get()
+ return self._obj:enum_legacy_prefix_get()
end,
doc_get = function(self)
- return M.Doc(self.typedecl:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
file_get = function(self)
- return self.typedecl:file_get()
+ return self._obj:file_get()
end,
base_type_get = function(self)
- local v = self.typedecl:base_type_get()
+ local v = self._obj:base_type_get()
if not v then
return nil
end
end,
aliased_base_get = function(self)
- local v = self.typedecl:aliased_base_get()
+ local v = self._obj:aliased_base_get()
if not v then
return nil
end
end,
is_extern = function(self)
- return self.typedecl:is_extern()
+ return self._obj:is_extern()
end,
c_type_get = function(self)
- return self.typedecl:c_type_get()
- end,
-
- name_get = function(self)
- return self.typedecl:name_get()
- end,
-
- full_name_get = function(self)
- return self.typedecl:full_name_get()
- end,
-
- namespaces_get = function(self)
- return self.typedecl:namespaces_get():to_array()
+ return self._obj:c_type_get()
end,
free_func_get = function(self)
- return self.typedecl:free_func_get()
+ return self._obj:free_func_get()
end,
function_pointer_get = function(self)
- local v = self.typedecl:function_pointer_get()
+ local v = self._obj:function_pointer_get()
if not v then
return nil
end
serialize = function(self)
local tpt = self:type_get()
if tpt == self.UNKNOWN then
- error("unknown typedecl: " .. self:full_name_get())
+ error("unknown typedecl: " .. self:name_get())
elseif tpt == self.STRUCT or
tpt == self.STRUCT_OPAQUE then
local buf = { "struct " }
add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:full_name_get()
+ buf[#buf + 1] = self:name_get()
if tpt == self.STRUCT_OPAQUE then
buf[#buf + 1] = ";"
return table.concat(buf)
elseif tpt == self.ENUM then
local buf = { "enum " }
add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:full_name_get()
+ buf[#buf + 1] = self:name_get()
local fields = self:enum_fields_get()
if #fields == 0 then
buf[#buf + 1] = " {}"
elseif tpt == self.ALIAS then
local buf = { "type " }
add_typedecl_attrs(self, buf)
- buf[#buf + 1] = self:full_name_get()
+ buf[#buf + 1] = self:name_get()
buf[#buf + 1] = ": "
buf[#buf + 1] = self:base_type_get():serialize()
buf[#buf + 1] = ";"
serialize_c = function(self, ns)
local tpt = self:type_get()
if tpt == self.UNKNOWN then
- error("unknown typedecl: " .. self:full_name_get())
+ error("unknown typedecl: " .. self:name_get())
elseif tpt == self.STRUCT or
tpt == self.STRUCT_OPAQUE then
local buf = { "typedef struct " }
- local fulln = self:full_name_get():gsub("%.", "_");
+ local fulln = self:name_get():gsub("%.", "_");
keyref.add(fulln, ns, "c")
buf[#buf + 1] = "_" .. fulln;
if tpt == self.STRUCT_OPAQUE then
return table.concat(buf)
elseif tpt == self.ENUM then
local buf = { "typedef enum" }
- local fulln = self:full_name_get():gsub("%.", "_");
+ local fulln = self:name_get():gsub("%.", "_");
keyref.add(fulln, ns, "c")
local fields = self:enum_fields_get()
if #fields == 0 then
buf[#buf + 1] = "} " .. fulln .. ";"
return table.concat(buf)
elseif tpt == self.ALIAS then
- local fulln = self:full_name_get():gsub("%.", "_");
+ local fulln = self:name_get():gsub("%.", "_");
keyref.add(fulln, ns, "c")
return "typedef "
.. M.type_cstr_get(self:base_type_get(), fulln) .. ";"
CONSTANT = eolian.variable_type.CONSTANT,
GLOBAL = eolian.variable_type.GLOBAL,
- __ctor = function(self, var)
- self.variable = var
- assert(self.variable)
- end,
-
type_get = function(self)
- return self.variable:type_get()
+ return self._obj:type_get()
end,
type_str_get = function(self)
end,
doc_get = function(self)
- return M.Doc(self.variable:documentation_get())
+ return M.Doc(self._obj:documentation_get())
end,
file_get = function(self)
- return self.variable:file_get()
+ return self._obj:file_get()
end,
base_type_get = function(self)
- local v = self.variable:base_type_get()
+ local v = self._obj:base_type_get()
if not v then
return nil
end
end,
value_get = function(self)
- local v = self.variable:value_get()
+ local v = self._obj:value_get()
if not v then
return nil
end
return M.Expression(v)
end,
- name_get = function(self)
- return self.variable:name_get()
- end,
-
- full_name_get = function(self)
- return self.variable:full_name_get()
- end,
-
- namespaces_get = function(self)
- return self.variable:namespaces_get():to_array()
- end,
-
is_extern = function(self)
- return self.variable:is_extern()
+ return self._obj:is_extern()
end,
nspaces_get = function(self, root)
if self:is_extern() then
buf[#buf + 1] = "@extern "
end
- buf[#buf + 1] = self:full_name_get()
+ buf[#buf + 1] = self:name_get()
buf[#buf + 1] = ": "
buf[#buf + 1] = self:base_type_get():serialize()
local val = self:value_get()
serialize_c = function(self, ns)
local buf = {}
local bt = self:base_type_get()
- local fulln = self:full_name_get():gsub("%.", "_"):upper()
+ local fulln = self:name_get():gsub("%.", "_"):upper()
keyref.add(fulln, ns, "c")
if self:type_get() == self.GLOBAL then
local ts = bt:c_type_get()
}
M.Expression = Node:clone {
- __ctor = function(self, expr)
- self.expr = expr
- assert(self.expr)
- end,
-
eval_enum = function(self)
- return self.expr:eval(eolian.expression_mask.INT)
+ return self._obj:eval(eolian.expression_mask.INT)
end,
eval_type = function(self, tp)
- return self.expr:eval_type(tp.type)
+ return self._obj:eval_type(tp.type)
end,
serialize = function(self)
- return self.expr:serialize()
+ return self._obj:serialize()
end
}
M.Implement = Node:clone {
- __ctor = function(self, impl)
- self.impl = impl
- assert(self.impl)
- end,
-
- full_name_get = function(self)
- return self.impl:full_name_get()
- end,
-
class_get = function(self)
local ccl = self._cache_cl
if ccl then
return ccl
end
-- so that we don't re-instantiate, it gets cached over there too
- ccl = M.Class.by_name_get(self.impl:class_get():full_name_get())
+ ccl = M.Class.by_name_get(self._obj:class_get():name_get())
self._cache_cl = ccl
return ccl
end,
if func then
return func, tp
end
- func, tp = self.impl:function_get()
+ func, tp = self._obj:function_get()
func = M.Function(func)
self._cache_func, self._cache_tp = func, tp
return func, tp
end,
doc_get = function(self, ftype, inh)
- return M.Doc(self.impl:documentation_get(ftype))
+ return M.Doc(self._obj:documentation_get(ftype))
end,
fallback_doc_get = function(self, inh)
end,
is_auto = function(self, ftype)
- return self.impl:is_auto(ftype)
+ return self._obj:is_auto(ftype)
end,
is_empty = function(self, ftype)
- return self.impl:is_empty(ftype)
+ return self._obj:is_empty(ftype)
end,
is_pure_virtual = function(self, ftype)
- return self.impl:is_pure_virtual(ftype)
+ return self._obj:is_pure_virtual(ftype)
end,
is_prop_get = function(self)
- return self.impl:is_prop_get()
+ return self._obj:is_prop_get()
end,
is_prop_set = function(self)
- return self.impl:is_prop_set()
+ return self._obj:is_prop_set()
end,
is_overridden = function(self, cl)
- return cl.class ~= self.impl:class_get()
+ return cl.class ~= self._obj:class_get()
end
}
-M.DocTokenizer = Node:clone {
+M.DocTokenizer = util.Object:clone {
UNKNOWN = eolian.doc_token_type.UNKNOWN,
TEXT = eolian.doc_token_type.TEXT,
REF = eolian.doc_token_type.REF,
if tp == reft.CLASS or tp == reft.FUNC or tp == reft.EVENT then
if not class_type_str[d1:type_get()] then
error("unknown class type for class '"
- .. d1:full_name_get() .. "'")
+ .. d1:name_get() .. "'")
end
elseif tp == reft.ALIAS then
elseif tp == reft.STRUCT or tp == reft.STRUCT_FIELD then
else
error("invalid reference '" .. self:text_get() .. "'")
end
- for tok in d1:full_name_get():gmatch("[^%.]+") do
+ for tok in d1:name_get():gmatch("[^%.]+") do
ret[#ret + 1] = tok:lower()
end
if tp == reft.FUNC then
end
-- build reverse inheritance hierarchy
for cl in eos:classes_get() do
- local cln = cl:full_name_get()
+ local cln = cl:name_get()
for icl in cl:inherits_get() do
local t = revh[icl]
if not t then
t = {}
revh[icl] = t
end
- t[#t + 1] = M.Class.by_name_get(cl:full_name_get())
+ t[#t + 1] = M.Class.by_name_get(cl:name_get())
end
end
end
writer.Buffer():write_link(
iscl and v:nspaces_get(true)
or dtree.Node.nspaces_get(v, true),
- v:full_name_get()
+ v:name_get()
):finish(),
v:doc_get():brief_get()
}
lvl = lvl or 0
local lbuf = writer.Buffer()
if lvl > 0 then
- lbuf:write_link(cl:nspaces_get(true), cl:full_name_get())
+ lbuf:write_link(cl:nspaces_get(true), cl:name_get())
lbuf:write_raw(" ")
lbuf:write_i("(" .. cl:type_str_get() .. ")")
buf = buf or writer.Buffer()
buf:write_raw(" => ")
- buf:write_link(cl:nspaces_get(true), cl:full_name_get())
+ buf:write_link(cl:nspaces_get(true), cl:name_get())
buf:write_raw(" ")
buf:write_i("(" .. cl:type_str_get() .. ")")
find_parent_impl = function(fulln, cl)
for i, pcl in ipairs(cl:inherits_get()) do
for j, impl in ipairs(pcl:implements_get()) do
- if impl:full_name_get() == fulln then
+ if impl:name_get() == fulln then
return impl, pcl
end
end
table.sort(nt, function(v1, v2)
local cl1, cl2 = v1[0], v2[0]
if cl1 ~= cl2 then
- return cl1:full_name_get() < cl2:full_name_get()
+ return cl1:name_get() < cl2:name_get()
end
local f1, f2 = v1[1], v2[1]
local doc = impl:doc_get(func.METHOD, true)
local docf = impl:fallback_doc_get(true)
if over and (not doc:exists() and (not docf or not docf:exists())) then
- bdoc = find_parent_briefdoc(impl:full_name_get(), cl)
+ bdoc = find_parent_briefdoc(impl:name_get(), cl)
else
bdoc = doc:brief_get(docf)
end
-- but we get latest doc every time so it's ok for now
local llbuf = writer.Buffer()
llbuf:write_raw(" [Overridden from ")
- llbuf:write_link(ocl:nspaces_get(true), ocl:full_name_get())
+ llbuf:write_link(ocl:nspaces_get(true), ocl:name_get())
llbuf:write_raw("]")
f:write_i(llbuf:finish())
end
if cl ~= prevcl then
prevcl = cl
f:write_raw("^ ")
- f:write_link(cl:nspaces_get(true), cl:full_name_get())
+ f:write_link(cl:nspaces_get(true), cl:name_get())
f:write_raw(" ^^^")
f:write_nl()
end
table.sort(nt, function(v1, v2)
if v1[0] ~= v2[0] then
- return v1[0]:full_name_get() < v2[0]:full_name_get()
+ return v1[0]:name_get() < v2[0]:name_get()
end
return v1[2] < v2[2]
if cl ~= prevcl then
prevcl = cl
f:write_raw("^ ")
- f:write_link(cl:nspaces_get(true), cl:full_name_get())
+ f:write_link(cl:nspaces_get(true), cl:name_get())
f:write_raw(" ^^^")
f:write_nl()
end
local build_class = function(cl)
local cln = cl:nspaces_get()
- local fulln = cl:full_name_get()
+ local fulln = cl:name_get()
local f = writer.Writer(cln, fulln)
printgen("Generating class: " .. fulln)
- f:write_h(cl:full_name_get() .. " (" .. cl:type_str_get() .. ")", 1)
+ f:write_h(cl:name_get() .. " (" .. cl:type_str_get() .. ")", 1)
f:write_h("Description", 2)
f:write_raw(cl:doc_get():full_get(nil, true))
local build_alias = function(tp)
local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:full_name_get()
+ local fulln = tp:name_get()
local f = writer.Writer(ns, fulln)
printgen("Generating alias: " .. fulln)
local build_struct = function(tp)
local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:full_name_get()
+ local fulln = tp:name_get()
local f = writer.Writer(ns, fulln)
printgen("Generating struct: " .. fulln)
local build_enum = function(tp)
local ns = dtree.Node.nspaces_get(tp)
- local fulln = tp:full_name_get()
+ local fulln = tp:name_get()
local f = writer.Writer(ns, fulln)
printgen("Generating enum: " .. fulln)
local build_variable = function(v, constant)
local ns = v:nspaces_get()
- local fulln = v:full_name_get()
+ local fulln = v:name_get()
local f = writer.Writer(ns, fulln)
printgen("Generating variable: " .. fulln)
end
local buf = writer.Buffer()
buf:write_raw("Overridden from ")
- local pimpl, pcl = find_parent_impl(impl:full_name_get(), cl)
+ local pimpl, pcl = find_parent_impl(impl:name_get(), cl)
buf:write_link(
- impl:function_get():nspaces_get(pcl, true), impl:full_name_get()
+ impl:function_get():nspaces_get(pcl, true), impl:name_get()
)
if prop then
buf:write_raw(" ")
local get_all_impls_of
get_all_impls_of = function(tbl, cl, fn, got)
- local cfn = cl:full_name_get()
+ local cfn = cl:name_get()
if got[cfn] then
return
end
local fn = impl:function_get()
local fnn = fn:name_get()
local ocl = fn:implement_get():class_get()
- local onm = ocl:full_name_get() .. "." .. fnn
+ local onm = ocl:name_get() .. "." .. fnn
local imps = impls_of[onm]
if not imps then
imps = {}
local t = {}
for i, icl in ipairs(imps) do
local buf = writer.Buffer()
- local cfn = icl:full_name_get() .. "." .. fnn
+ local cfn = icl:name_get() .. "." .. fnn
if icl:is_same(cl) then
buf:write_b(cfn)
else
local over = impl:is_overridden(cl)
local fn = impl:function_get()
local mns = fn:nspaces_get(cl)
- local methn = cl:full_name_get() .. "." .. fn:name_get()
+ local methn = cl:name_get() .. "." .. fn:name_get()
local f = writer.Writer(mns, methn)
printgen("Generating method: " .. methn)
local doc = impl:doc_get(fn.METHOD)
if over and not doc:exists() then
- doc = find_parent_doc(impl:full_name_get(), cl, fn.METHOD)
+ doc = find_parent_doc(impl:name_get(), cl, fn.METHOD)
end
f:write_h("Description", 2)
local over = impl:is_overridden(cl)
local fn = impl:function_get()
local pns = fn:nspaces_get(cl)
- local propn = cl:full_name_get() .. "." .. fn:name_get()
+ local propn = cl:name_get() .. "." .. fn:name_get()
local f = writer.Writer(pns, propn)
printgen("Generating property: " .. propn)
if over then
if not doc:exists() then
- doc = find_parent_doc(impl:full_name_get(), cl, fn.PROPERTY)
+ doc = find_parent_doc(impl:name_get(), cl, fn.PROPERTY)
end
if isget and not gdoc:exists() then
- gdoc = find_parent_doc(impl:full_name_get(), cl, fn.PROP_GET)
+ gdoc = find_parent_doc(impl:name_get(), cl, fn.PROP_GET)
end
if isset and not sdoc:exists() then
- sdoc = find_parent_doc(impl:full_name_get(), cl, fn.PROP_SET)
+ sdoc = find_parent_doc(impl:name_get(), cl, fn.PROP_SET)
end
end
build_event = function(ev, cl)
local evn = ev:nspaces_get(cl)
- local evnm = cl:full_name_get() .. ": " .. ev:name_get()
+ local evnm = cl:name_get() .. ": " .. ev:name_get()
local f = writer.Writer(evn, evnm)
printgen("Generating event: " .. evnm)
local build_stats_keyref = function()
for i, cl in ipairs(dtree.Class.all_get()) do
stats.check_class(cl)
- keyref.add(cl:full_name_get():gsub("%.", "_"), cl:nspaces_get(), "c")
+ keyref.add(cl:name_get():gsub("%.", "_"), cl:nspaces_get(), "c")
for i, imp in ipairs(cl:implements_get()) do
-- TODO: handle doc overrides in stats system
if not imp:is_overridden(cl) then
if st == "clist" then
for i, cl in ipairs(dtree.Class.all_get()) do
- print(cl:full_name_get())
+ print(cl:name_get())
end
return
end