const Eolian_Class *impl_class = eolian_implement_class_get(impl_desc);
Eolian_Function_Type impl_type;
const Eolian_Function *impl_func = eolian_implement_function_get(impl_desc, &impl_type);
- if (impl_type == EOLIAN_CTOR)
+ /* fixme */
+ if (eolian_function_is_constructing(impl_func))
{
efl::eolian::eo_constructor constructor;
std::string parent = safe_lower(eolian_class_full_name_get(impl_class));
EINA_ITERATOR_FOREACH(constructors, curr)
{
Eolian_Function *eo_constructor = static_cast<Eolian_Function*>(curr);
+ /* fixme */
if (!eolian_function_is_constructing(eo_constructor))
continue;
efl::eolian::eo_constructor constructor;
{
efl::eolian::eo_function func_;
Eolian_Function *eol_func = static_cast<Eolian_Function*>(curr);
+ /* fixme */
if (eolian_function_is_constructing(eol_func))
continue;
// XXX Eolian only provides regular methods so far
struct method_t { static constexpr ::Eolian_Function_Type value = ::EOLIAN_METHOD; };
method_t const method = {};
-struct ctor_t { static constexpr ::Eolian_Function_Type value = ::EOLIAN_CTOR; };
+/* fixme */
+struct ctor_t { static constexpr ::Eolian_Function_Type value = ::EOLIAN_METHOD; };
ctor_t const ctor = {};
inline const Eolian_Class*
EOLIAN_PROPERTY,
EOLIAN_PROP_SET,
EOLIAN_PROP_GET,
- EOLIAN_METHOD,
- EOLIAN_CTOR
+ EOLIAN_METHOD
} Eolian_Function_Type;
typedef enum
free(impl);
}
- EINA_LIST_FREE(cl->constructors, fid) database_function_del(fid);
EINA_LIST_FREE(cl->methods, fid) database_function_del(fid);
EINA_LIST_FREE(cl->properties, fid) database_function_del(fid);
EINA_LIST_FREE(cl->events, ev) database_event_del(ev);
}
}
- if (f_type == EOLIAN_UNRESOLVED || f_type == EOLIAN_CTOR)
- {
- EINA_LIST_FOREACH(cl->constructors, itr, fid)
- {
- if (!strcmp(fid->name, func_name))
- return fid;
- }
- }
-
ERR("Function %s not found in class %s", func_name, cl->name);
return NULL;
}
return (cl->properties ? eina_list_iterator_new(cl->properties) : NULL);
case EOLIAN_METHOD:
return (cl->methods ? eina_list_iterator_new(cl->methods) : NULL);
- case EOLIAN_CTOR:
- return (cl->constructors ? eina_list_iterator_new(cl->constructors) : NULL);
default: return NULL;
}
}
return EINA_TRUE;
}
-static Eina_Bool
-_db_fill_ctor(Eolian_Class *cl, Eo_Method_Def *meth)
-{
- Eolian_Function *foo_id = database_function_new(meth->name, EOLIAN_CTOR);
-
- cl->constructors = eina_list_append(cl->constructors, foo_id);
-
- if (meth->ret)
- foo_id->get_return_comment = eina_stringshare_ref(meth->ret->comment);
-
- foo_id->get_legacy = eina_stringshare_ref(meth->legacy);
-
- _db_fill_params(meth->params, &(foo_id->params));
-
- foo_id->base = meth->base;
- meth->base.file = NULL;
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_db_fill_ctors(Eolian_Class *cl, Eo_Class_Def *kls)
-{
- Eo_Method_Def *meth;
- Eina_List *l;
-
- EINA_LIST_FOREACH(kls->constructors, l, meth)
- if (!_db_fill_ctor(cl, meth)) return EINA_FALSE;
-
- return EINA_TRUE;
-}
-
static int
_db_fill_implement(Eolian_Class *cl, Eolian_Implement *impl)
{
if (kls->data_type)
cl->data_type = eina_stringshare_ref(kls->data_type);
- if (!_db_fill_ctors (cl, kls)) return EINA_FALSE;
if (!_db_fill_properties(cl, kls)) return EINA_FALSE;
if (!_db_fill_methods (cl, kls)) return EINA_FALSE;
if (!_db_fill_implements(cl, kls)) return EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
switch (ftype)
{
- case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_CTOR: case EOLIAN_PROP_GET: return fid->get_legacy; break;
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_legacy; break;
case EOLIAN_PROP_SET: return fid->set_legacy; break;
default: return NULL;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
switch (ftype)
{
- case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_CTOR: case EOLIAN_PROP_GET: return fid->get_description; break;
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_description; break;
case EOLIAN_PROP_SET: return fid->set_description; break;
default: return NULL;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
switch (ftype)
{
- case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_CTOR: case EOLIAN_PROP_GET: return fid->get_virtual_pure; break;
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_virtual_pure; break;
case EOLIAN_PROP_SET: return fid->set_virtual_pure; break;
default: return EINA_FALSE;
}
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
switch (ftype)
{
- case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_CTOR: case EOLIAN_PROP_GET: return fid->get_only_legacy; break;
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_only_legacy; break;
case EOLIAN_PROP_SET: return fid->set_only_legacy; break;
default: return EINA_FALSE;
}
switch (ftype)
{
case EOLIAN_PROP_SET: return fid->set_ret_type;
- case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_CTOR: case EOLIAN_PROP_GET: return fid->get_ret_type;
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROP_GET: return fid->get_ret_type;
default: return NULL;
}
}
switch (ftype)
{
case EOLIAN_PROP_SET: return fid->set_ret_val;
- case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_CTOR: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_ret_val;
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_ret_val;
default: return NULL;
}
}
switch (ftype)
{
case EOLIAN_PROP_SET: return fid->set_return_comment; break;
- case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_CTOR: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_return_comment; break;
+ case EOLIAN_UNRESOLVED: case EOLIAN_METHOD: case EOLIAN_PROPERTY: case EOLIAN_PROP_GET: return fid->get_return_comment; break;
default: return NULL;
}
}
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
switch (ftype)
{
- case EOLIAN_METHOD: case EOLIAN_PROP_GET: case EOLIAN_CTOR: case EOLIAN_PROPERTY: return fid->get_return_warn_unused;
+ case EOLIAN_METHOD: case EOLIAN_PROP_GET: case EOLIAN_PROPERTY: return fid->get_return_warn_unused;
case EOLIAN_PROP_SET: return fid->set_return_warn_unused;
default: return EINA_FALSE;
}
if (fid->obj_is_const) printf("%*sobj const: <true>\n", nb_spaces + 5, "");
break;
}
- case EOLIAN_CTOR:
- {
- //char *str = eina_hash_find(fid->data, "comment");
- const char *str = eolian_function_description_get(fid, EOLIAN_METHOD);
- if (str) printf("%*s<%s>\n", nb_spaces + 5, "", str);
- str = eolian_function_legacy_get(fid, EOLIAN_METHOD);
- if (str) printf("%*slegacy: <%s>\n", nb_spaces + 5, "", str);
- tp = eolian_function_return_type_get(fid, EOLIAN_METHOD);
- if (tp)
- {
- printf("%*sreturn type: <", nb_spaces + 5, "");
- database_type_print((Eolian_Type*)tp);
- printf(">\n");
- }
- break;
- }
default:
return EINA_FALSE;
}
printf(" Data type: <%s>\n", cl->data_type);
}
- // Constructors
- printf(" constructors:\n");
- EINA_LIST_FOREACH(cl->constructors, itr, function)
- {
- _function_print(function, 4);
- }
- printf("\n");
-
// Properties
printf(" properties:\n");
EINA_LIST_FOREACH(cl->properties, itr, function)
if (!_validate_function(func))
return EINA_FALSE;
- EINA_LIST_FOREACH(cl->constructors, l, func)
- if (!_validate_function(func))
- return EINA_FALSE;
-
EINA_LIST_FOREACH(cl->events, l, event)
if (!_validate_event(event))
return EINA_FALSE;
EINA_LIST_FREE(kls->implements, impl)
database_implement_del(impl);
- EINA_LIST_FREE(kls->constructors, meth)
- eo_definitions_method_def_free(meth);
-
EINA_LIST_FREE(kls->properties, prop)
eo_definitions_property_def_free(prop);
Eina_List *inherits;
Eina_List *implements;
Eina_List *events;
- Eina_List *constructors;
Eina_List *properties;
Eina_List *methods;
} Eo_Class_Def;
#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \
KW(virtual), \
\
- KW(abstract), KW(constructor), KW(constructors), KW(data), \
- KW(destructor), KW(eo), KW(eo_prefix), KW(events), KW(free), KW(func), \
- KW(get), KW(implements), KW(interface), KW(keys), KW(legacy), \
- KW(legacy_prefix), KW(methods), KW(mixin), KW(own), KW(params), \
- KW(properties), KW(set), KW(type), KW(values), KW(var), KWAT(class), \
- KWAT(const), KWAT(constructor), KWAT(extern), KWAT(free), KWAT(in), \
- KWAT(inout), KWAT(nonull), KWAT(out), KWAT(private), KWAT(protected), \
- KWAT(warn_unused), \
+ KW(abstract), KW(constructor), KW(data), KW(destructor), KW(eo), \
+ KW(eo_prefix), KW(events), KW(free), KW(func), KW(get), KW(implements), \
+ KW(interface), KW(keys), KW(legacy), KW(legacy_prefix), KW(methods), \
+ KW(mixin), KW(own), KW(params), KW(properties), KW(set), KW(type), \
+ KW(values), KW(var), KWAT(class), KWAT(const), KWAT(constructor), \
+ KWAT(extern), KWAT(free), KWAT(in), KWAT(inout), KWAT(nonull), KWAT(out), \
+ KWAT(private), KWAT(protected), KWAT(warn_unused), \
\
KW(byte), KW(ubyte), KW(char), KW(short), KW(ushort), KW(int), KW(uint), \
KW(long), KW(ulong), KW(llong), KW(ullong), \
}
}
-static void
-parse_constructors(Eo_Lexer *ls)
-{
- PARSE_SECTION
- {
- parse_method(ls, EINA_TRUE);
- ls->tmp.kls->constructors = eina_list_append(ls->tmp.kls->constructors,
- ls->tmp.meth);
- ls->tmp.meth = NULL;
- }
- check_match(ls, '}', '{', line, col);
-}
-
static void
parse_methods(Eo_Lexer *ls)
{
}
static void
-parse_class_body(Eo_Lexer *ls, Eina_Bool allow_ctors, Eolian_Class_Type type)
+parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
{
Eina_Bool has_legacy_prefix = EINA_FALSE,
has_eo_prefix = EINA_FALSE,
has_data = EINA_FALSE,
- has_constructors = EINA_FALSE,
has_properties = EINA_FALSE,
has_methods = EINA_FALSE,
has_implements = EINA_FALSE,
eo_lexer_get(ls);
check_next(ls, ';');
break;
- case KW_constructors:
- if (!allow_ctors)
- return;
- CASE_LOCK(ls, constructors, "constructors definition")
- parse_constructors(ls);
- break;
case KW_properties:
CASE_LOCK(ls, properties, "properties definition")
parse_properties(ls);
}
static void
-parse_class(Eo_Lexer *ls, Eina_Bool allow_ctors, Eolian_Class_Type type)
+parse_class(Eo_Lexer *ls, Eolian_Class_Type type)
{
const char *bnm;
char *fnm;
line = ls->line_number;
col = ls->column;
check_next(ls, '{');
- parse_class_body(ls, allow_ctors, type);
+ parse_class_body(ls, type);
check_match(ls, '}', '{', line, col);
}
{
case KW_abstract:
if (eot) goto def;
- parse_class(ls, EINA_TRUE, EOLIAN_CLASS_ABSTRACT);
+ parse_class(ls, EOLIAN_CLASS_ABSTRACT);
goto found_class;
case KW_class:
if (eot) goto def;
- parse_class(ls, EINA_TRUE, EOLIAN_CLASS_REGULAR);
+ parse_class(ls, EOLIAN_CLASS_REGULAR);
goto found_class;
case KW_mixin:
if (eot) goto def;
- parse_class(ls, EINA_FALSE, EOLIAN_CLASS_MIXIN);
+ parse_class(ls, EOLIAN_CLASS_MIXIN);
goto found_class;
case KW_interface:
if (eot) goto def;
- parse_class(ls, EINA_FALSE, EOLIAN_CLASS_INTERFACE);
+ parse_class(ls, EOLIAN_CLASS_INTERFACE);
goto found_class;
case KW_type:
{
Eina_List *inherits; /* List Eina_Stringshare * */
Eina_List *properties; /* List prop_name -> Eolian_Function */
Eina_List *methods; /* List meth_name -> Eolian_Function */
- Eina_List *constructors; /* List constructor_name -> Eolian_Function */
Eina_List *implements; /* List implements name -> Eolian_Implement */
Eina_List *events; /* List event_name -> Eolian_Event */
Eina_Bool class_ctor_enable:1;