forked from enlightenment/efl
eolian: remove Eo_Class_Def (fill bits still remaining)
This commit is contained in:
parent
88327c1d9d
commit
f55572d79e
|
@ -4,46 +4,36 @@
|
|||
void
|
||||
database_class_del(Eolian_Class *cl)
|
||||
{
|
||||
Eina_Stringshare *inherit_name;
|
||||
Eina_List *inherits = cl->inherits;
|
||||
Eolian_Function *fid;
|
||||
Eolian_Event *ev;
|
||||
const char *sp;
|
||||
Eolian_Implement *impl;
|
||||
Eolian_Constructor *ctor;
|
||||
const char *s;
|
||||
|
||||
if (cl->base.file) eina_stringshare_del(cl->base.file);
|
||||
|
||||
EINA_LIST_FREE(inherits, inherit_name)
|
||||
eina_stringshare_del(inherit_name);
|
||||
EINA_LIST_FREE(cl->inherits, s)
|
||||
if (s) eina_stringshare_del(s);
|
||||
|
||||
Eolian_Implement *impl;
|
||||
Eina_List *implements = cl->implements;
|
||||
EINA_LIST_FREE(implements, impl)
|
||||
{
|
||||
eina_stringshare_del(impl->full_name);
|
||||
free(impl);
|
||||
}
|
||||
EINA_LIST_FREE(cl->implements, impl)
|
||||
database_implement_del(impl);
|
||||
|
||||
Eolian_Constructor *ctor;
|
||||
Eina_List *constructors = cl->constructors;
|
||||
EINA_LIST_FREE(constructors, ctor)
|
||||
{
|
||||
eina_stringshare_del(ctor->full_name);
|
||||
free(ctor);
|
||||
}
|
||||
EINA_LIST_FREE(cl->constructors, ctor)
|
||||
database_constructor_del(ctor);
|
||||
|
||||
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);
|
||||
|
||||
eina_stringshare_del(cl->name);
|
||||
eina_stringshare_del(cl->full_name);
|
||||
eina_stringshare_del(cl->description);
|
||||
eina_stringshare_del(cl->legacy_prefix);
|
||||
eina_stringshare_del(cl->eo_prefix);
|
||||
eina_stringshare_del(cl->data_type);
|
||||
if (cl->name) eina_stringshare_del(cl->name);
|
||||
if (cl->full_name) eina_stringshare_del(cl->full_name);
|
||||
if (cl->description) eina_stringshare_del(cl->description);
|
||||
if (cl->legacy_prefix) eina_stringshare_del(cl->legacy_prefix);
|
||||
if (cl->eo_prefix) eina_stringshare_del(cl->eo_prefix);
|
||||
if (cl->data_type) eina_stringshare_del(cl->data_type);
|
||||
|
||||
if (cl->namespaces) EINA_LIST_FREE(cl->namespaces, sp)
|
||||
eina_stringshare_del(sp);
|
||||
if (cl->namespaces) EINA_LIST_FREE(cl->namespaces, s)
|
||||
if (s) eina_stringshare_del(s);
|
||||
|
||||
free(cl);
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ _db_build_implement(Eolian_Class *cl, Eolian_Function *foo_id)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_db_fill_implements(Eolian_Class *cl, Eo_Class_Def *kls)
|
||||
_db_fill_implements(Eolian_Class *cl, Eolian_Class *kls)
|
||||
{
|
||||
Eolian_Implement *impl;
|
||||
Eolian_Function *foo_id;
|
||||
|
@ -222,7 +222,7 @@ _db_fill_constructor(Eolian_Class *cl, Eolian_Constructor *ctor)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_db_fill_constructors(Eolian_Class *cl, Eo_Class_Def *kls)
|
||||
_db_fill_constructors(Eolian_Class *cl, Eolian_Class *kls)
|
||||
{
|
||||
Eolian_Constructor *ctor;
|
||||
Eina_List *l;
|
||||
|
@ -237,7 +237,7 @@ _db_fill_constructors(Eolian_Class *cl, Eo_Class_Def *kls)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_db_fill_events(Eolian_Class *cl, Eo_Class_Def *kls)
|
||||
_db_fill_events(Eolian_Class *cl, Eolian_Class *kls)
|
||||
{
|
||||
Eolian_Event *event;
|
||||
Eina_List *l;
|
||||
|
@ -252,7 +252,7 @@ _db_fill_events(Eolian_Class *cl, Eo_Class_Def *kls)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_db_fill_class(Eo_Class_Def *kls)
|
||||
_db_fill_class(Eolian_Class *kls)
|
||||
{
|
||||
Eolian_Class *cl = database_class_add(kls->name, kls->type);
|
||||
const char *s;
|
||||
|
|
|
@ -3,50 +3,6 @@
|
|||
|
||||
#include "eo_definitions.h"
|
||||
|
||||
void
|
||||
eo_definitions_class_def_free(Eo_Class_Def *kls)
|
||||
{
|
||||
const char *s;
|
||||
Eolian_Function *func;
|
||||
Eolian_Event *sgn;
|
||||
Eolian_Implement *impl;
|
||||
Eolian_Constructor *ctor;
|
||||
|
||||
if (kls->base.file)
|
||||
eina_stringshare_del(kls->base.file);
|
||||
|
||||
if (kls->name)
|
||||
eina_stringshare_del(kls->name);
|
||||
if (kls->description)
|
||||
eina_stringshare_del(kls->description);
|
||||
if (kls->legacy_prefix)
|
||||
eina_stringshare_del(kls->legacy_prefix);
|
||||
if (kls->eo_prefix)
|
||||
eina_stringshare_del(kls->eo_prefix);
|
||||
if (kls->data_type)
|
||||
eina_stringshare_del(kls->data_type);
|
||||
|
||||
EINA_LIST_FREE(kls->inherits, s)
|
||||
if (s) eina_stringshare_del(s);
|
||||
|
||||
EINA_LIST_FREE(kls->implements, impl)
|
||||
database_implement_del(impl);
|
||||
|
||||
EINA_LIST_FREE(kls->constructors, ctor)
|
||||
database_constructor_del(ctor);
|
||||
|
||||
EINA_LIST_FREE(kls->properties, func)
|
||||
database_function_del(func);
|
||||
|
||||
EINA_LIST_FREE(kls->methods, func)
|
||||
database_function_del(func);
|
||||
|
||||
EINA_LIST_FREE(kls->events, sgn)
|
||||
database_event_del(sgn);
|
||||
|
||||
free(kls);
|
||||
}
|
||||
|
||||
void
|
||||
eo_definitions_temps_free(Eo_Lexer_Temps *tmp)
|
||||
{
|
||||
|
@ -66,7 +22,7 @@ eo_definitions_temps_free(Eo_Lexer_Temps *tmp)
|
|||
eina_stringshare_del(tmp->legacy_def);
|
||||
|
||||
if (tmp->kls)
|
||||
eo_definitions_class_def_free(tmp->kls);
|
||||
database_class_del(tmp->kls);
|
||||
|
||||
EINA_LIST_FREE(tmp->type_defs, tp)
|
||||
database_type_del(tp);
|
||||
|
|
|
@ -6,25 +6,6 @@
|
|||
|
||||
#include "eolian_database.h"
|
||||
|
||||
/* CLASS */
|
||||
|
||||
typedef struct _Eo_Class_Def
|
||||
{
|
||||
Eolian_Object base;
|
||||
Eina_Stringshare *name;
|
||||
Eolian_Class_Type type;
|
||||
Eina_Stringshare *description;
|
||||
Eina_Stringshare *legacy_prefix;
|
||||
Eina_Stringshare *eo_prefix;
|
||||
Eina_Stringshare *data_type;
|
||||
Eina_List *inherits;
|
||||
Eina_List *properties;
|
||||
Eina_List *methods;
|
||||
Eina_List *implements;
|
||||
Eina_List *constructors;
|
||||
Eina_List *events;
|
||||
} Eo_Class_Def;
|
||||
|
||||
/* TEMPS */
|
||||
|
||||
typedef struct _Eo_Lexer_Temps
|
||||
|
@ -32,7 +13,7 @@ typedef struct _Eo_Lexer_Temps
|
|||
Eina_List *str_bufs;
|
||||
Eina_List *params;
|
||||
Eina_Stringshare *legacy_def;
|
||||
Eo_Class_Def *kls;
|
||||
Eolian_Class *kls;
|
||||
Eina_List *type_defs;
|
||||
Eina_List *var_defs;
|
||||
Eolian_Function *func;
|
||||
|
@ -45,7 +26,6 @@ typedef struct _Eo_Lexer_Temps
|
|||
Eina_List *strs;
|
||||
} Eo_Lexer_Temps;
|
||||
|
||||
void eo_definitions_class_def_free(Eo_Class_Def *kls);
|
||||
void eo_definitions_temps_free(Eo_Lexer_Temps *tmp);
|
||||
|
||||
#endif /* __EO_DEFINITIONS_H__ */
|
||||
|
|
|
@ -718,7 +718,7 @@ eo_lexer_free(Eo_Lexer *ls)
|
|||
switch (nd->type)
|
||||
{
|
||||
case NODE_CLASS:
|
||||
eo_definitions_class_def_free(nd->def_class);
|
||||
database_class_del(nd->def_class);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -91,15 +91,12 @@ enum Nodes
|
|||
NODE_CLASS = 0
|
||||
};
|
||||
|
||||
/* represents a node, aka a result of parsing - currently class, typedef
|
||||
* or struct, they're all stored in a list in lexer state and their type
|
||||
* is determined by enum Nodes above */
|
||||
typedef struct _Eo_Node
|
||||
{
|
||||
unsigned char type;
|
||||
union {
|
||||
void *def;
|
||||
Eo_Class_Def *def_class;
|
||||
Eolian_Class *def_class;
|
||||
};
|
||||
} Eo_Node;
|
||||
|
||||
|
|
|
@ -249,6 +249,12 @@ _fill_variable_name(Eolian_Variable *var, const char *var_name)
|
|||
NAMESPACE_PARSE(var, var_name)
|
||||
}
|
||||
|
||||
static void
|
||||
_fill_class_name(Eolian_Class *cl, const char *cl_name)
|
||||
{
|
||||
NAMESPACE_PARSE(cl, cl_name)
|
||||
}
|
||||
|
||||
#undef NAMESPACE_PARSE
|
||||
|
||||
static Eolian_Expression *
|
||||
|
@ -1880,7 +1886,7 @@ parse_class(Eo_Lexer *ls, Eolian_Class_Type type)
|
|||
Eina_Bool same;
|
||||
int line, col;
|
||||
Eina_Strbuf *buf = push_strbuf(ls);
|
||||
ls->tmp.kls = calloc(1, sizeof(Eo_Class_Def));
|
||||
ls->tmp.kls = calloc(1, sizeof(Eolian_Class));
|
||||
ls->tmp.kls->base.file = eina_stringshare_ref(ls->filename);
|
||||
ls->tmp.kls->base.line = ls->line_number;
|
||||
ls->tmp.kls->base.column = ls->column;
|
||||
|
|
Loading…
Reference in New Issue