q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2219c0329d7ee5ea177e12a6bf736f0b084f7fbb

commit 2219c0329d7ee5ea177e12a6bf736f0b084f7fbb
Author: Daniel Kolesa <d.kol...@samsung.com>
Date:   Wed Sep 10 16:58:29 2014 +0100

    eolian: remove Eo_Property_Def
---
 src/lib/eolian/database_fill.c  | 101 +---------------------------------------
 src/lib/eolian/eo_definitions.c |  53 ++-------------------
 src/lib/eolian/eo_definitions.h |  32 +------------
 src/lib/eolian/eo_parser.c      |  25 ++++++++--
 4 files changed, 25 insertions(+), 186 deletions(-)

diff --git a/src/lib/eolian/database_fill.c b/src/lib/eolian/database_fill.c
index 33ef6ec..46be5fb 100644
--- a/src/lib/eolian/database_fill.c
+++ b/src/lib/eolian/database_fill.c
@@ -1,104 +1,5 @@
 #include "eo_parser.h"
 
-static void
-_db_fill_property(Eolian_Class *cl, Eo_Class_Def *kls, Eo_Property_Def *prop)
-{
-   Eolian_Function *foo_id = database_function_new(prop->name,
-                                                   EOLIAN_UNRESOLVED);
-
-   foo_id->scope = prop->scope;
-   foo_id->is_class = prop->is_class;
-
-   foo_id->keys   = prop->keys  ; prop->keys   = NULL;
-   foo_id->params = prop->params; prop->params = NULL;
-
-   if (prop->get_ret_type)
-     {
-        foo_id->get_ret_type = prop->get_ret_type;
-        prop->get_ret_type = NULL;
-        foo_id->get_ret_val = prop->get_ret_val;
-        prop->get_ret_val = NULL;
-        foo_id->get_return_comment = prop->get_return_comment;
-        prop->get_return_comment = NULL;
-        foo_id->get_return_warn_unused = prop->get_return_warn_unused;
-     }
-   if (prop->set_ret_type)
-     {
-        foo_id->set_ret_type = prop->set_ret_type;
-        prop->set_ret_type = NULL;
-        foo_id->set_ret_val = prop->set_ret_val;
-        prop->set_ret_val = NULL;
-        foo_id->set_return_comment = prop->set_return_comment;
-        prop->set_return_comment = NULL;
-        foo_id->set_return_warn_unused = prop->set_return_warn_unused;
-     }
-
-   if (prop->get_legacy)
-     {
-        foo_id->get_legacy = prop->get_legacy;
-        prop->get_legacy = NULL;
-    }
-   if (prop->set_legacy)
-     {
-        foo_id->set_legacy = prop->set_legacy;
-        prop->set_legacy = NULL;
-    }
-   foo_id->get_only_legacy = prop->get_only_legacy;
-   foo_id->set_only_legacy = prop->set_only_legacy;
-
-   if (prop->get_description)
-     {
-        foo_id->get_description = prop->get_description;
-        prop->get_description = NULL;
-    }
-   if (prop->set_description)
-     {
-        foo_id->set_description = prop->set_description;
-        prop->set_description = NULL;
-    }
-
-   foo_id->type = prop->type;
-
-   if (prop->get_accessor)
-     {
-        foo_id->base = prop->base;
-        prop->base.file = NULL;
-     }
-
-   if (prop->set_accessor)
-     {
-        foo_id->set_base = prop->set_base;
-        prop->set_base.file = NULL;
-     }
-   else
-     {
-        foo_id->base = prop->base;
-        prop->base.file = NULL;
-     }
-
-   if (kls->type == EOLIAN_CLASS_INTERFACE)
-     {
-        if (foo_id->type == EOLIAN_PROP_GET)
-          foo_id->get_virtual_pure = EINA_TRUE;
-        else if (foo_id->type == EOLIAN_PROP_SET)
-          foo_id->set_virtual_pure = EINA_TRUE;
-        if (foo_id->type == EOLIAN_PROPERTY)
-          foo_id->get_virtual_pure = foo_id->set_virtual_pure = EINA_TRUE;
-     }
-
-   cl->properties = eina_list_append(cl->properties, foo_id);
-}
-
-static void
-_db_fill_properties(Eolian_Class *cl, Eo_Class_Def *kls)
-{
-   Eo_Property_Def *prop;
-   Eina_List *l;
-
-   EINA_LIST_FOREACH(kls->properties, l, prop)
-     _db_fill_property(cl, kls, prop);
-}
-
 static Eina_Bool
 _db_fill_method(Eolian_Class *cl, Eo_Class_Def *kls, Eo_Method_Def *meth)
 {
@@ -422,7 +323,7 @@ _db_fill_class(Eo_Class_Def *kls)
    if (kls->data_type)
      cl->data_type = eina_stringshare_ref(kls->data_type);
 
-   _db_fill_properties(cl, kls);
+   cl->properties = kls->properties; kls->properties = NULL;
 
    if (!_db_fill_methods     (cl, kls)) return EINA_FALSE;
    if (!_db_fill_implements  (cl, kls)) return EINA_FALSE;
diff --git a/src/lib/eolian/eo_definitions.c b/src/lib/eolian/eo_definitions.c
index 4511e39..ca4580c 100644
--- a/src/lib/eolian/eo_definitions.c
+++ b/src/lib/eolian/eo_definitions.c
@@ -4,53 +4,6 @@
 #include "eo_definitions.h"
 
 static void
-eo_definitions_property_def_free(Eo_Property_Def *prop)
-{
-   Eolian_Function_Parameter *param;
-
-   if (prop->base.file)
-     eina_stringshare_del(prop->base.file);
-
-   if (prop->name)
-     eina_stringshare_del(prop->name);
-
-   EINA_LIST_FREE(prop->keys, param)
-     database_parameter_del(param);
-
-   EINA_LIST_FREE(prop->params, param)
-     database_parameter_del(param);
-
-   if (prop->get_description)
-     eina_stringshare_del(prop->get_description);
-
-   if (prop->set_description)
-     eina_stringshare_del(prop->set_description);
-
-   if (prop->get_legacy)
-     eina_stringshare_del(prop->get_legacy);
-
-   if (prop->set_legacy)
-     eina_stringshare_del(prop->set_legacy);
-
-   if (prop->get_ret_type)
-     database_type_del(prop->get_ret_type);
-
-   if (prop->set_ret_type)
-     database_type_del(prop->set_ret_type);
-
-   if (prop->get_return_comment)
-     eina_stringshare_del(prop->get_return_comment);
-
-   if (prop->set_return_comment)
-     eina_stringshare_del(prop->set_return_comment);
-
-   database_expr_del(prop->get_ret_val);
-   database_expr_del(prop->set_ret_val);
-
-   free(prop);
-}
-
-static void
 eo_definitions_method_def_free(Eo_Method_Def *meth)
 {
    Eolian_Function_Parameter *param;
@@ -83,7 +36,7 @@ void
 eo_definitions_class_def_free(Eo_Class_Def *kls)
 {
    const char *s;
-   Eo_Property_Def *prop;
+   Eolian_Function *prop;
    Eo_Method_Def *meth;
    Eolian_Event *sgn;
    Eolian_Implement *impl;
@@ -113,7 +66,7 @@ eo_definitions_class_def_free(Eo_Class_Def *kls)
      database_constructor_del(ctor);
 
    EINA_LIST_FREE(kls->properties, prop)
-     eo_definitions_property_def_free(prop);
+     database_function_del(prop);
 
    EINA_LIST_FREE(kls->methods, meth)
      eo_definitions_method_def_free(meth);
@@ -152,7 +105,7 @@ eo_definitions_temps_free(Eo_Lexer_Temps *tmp)
      database_var_del(var);
 
    if (tmp->prop)
-     eo_definitions_property_def_free(tmp->prop);
+     database_function_del(tmp->prop);
 
    if (tmp->meth)
      eo_definitions_method_def_free(tmp->meth);
diff --git a/src/lib/eolian/eo_definitions.h b/src/lib/eolian/eo_definitions.h
index a6e25e1..e25a565 100644
--- a/src/lib/eolian/eo_definitions.h
+++ b/src/lib/eolian/eo_definitions.h
@@ -6,36 +6,6 @@
 
 #include "eolian_database.h"
 
-/* PROPERTY */
-
-typedef struct _Eo_Property_Def
-{
-   Eolian_Object base;
-   Eolian_Object set_base;
-   Eina_Stringshare *name;
-   Eina_List *keys;
-   Eina_List *params;
-   Eolian_Function_Type type;
-   Eolian_Object_Scope scope;
-   Eolian_Type *get_ret_type;
-   Eolian_Type *set_ret_type;
-   Eolian_Expression *get_ret_val;
-   Eolian_Expression *set_ret_val;
-   Eina_Stringshare *get_return_comment;
-   Eina_Stringshare *set_return_comment;
-   Eina_Stringshare *get_legacy;
-   Eina_Stringshare *set_legacy;
-   Eina_Stringshare *get_description;
-   Eina_Stringshare *set_description;
-   Eina_Bool get_accessor: 1;
-   Eina_Bool set_accessor: 1;
-   Eina_Bool get_return_warn_unused :1; /* also used for methods */
-   Eina_Bool set_return_warn_unused :1;
-   Eina_Bool get_only_legacy: 1;
-   Eina_Bool set_only_legacy: 1;
-   Eina_Bool is_class:1;
-} Eo_Property_Def;
-
 /* METHOD */
 
 typedef struct _Eo_Method_Def
@@ -85,7 +55,7 @@ typedef struct _Eo_Lexer_Temps
    Eo_Class_Def *kls;
    Eina_List *type_defs;
    Eina_List *var_defs;
-   Eo_Property_Def *prop;
+   Eolian_Function *prop;
    Eo_Method_Def *meth;
    Eolian_Function_Parameter *param;
    Eina_List *str_items;
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index baf6d7c..fef5d12 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -1223,7 +1223,7 @@ parse_legacy(Eo_Lexer *ls)
 }
 
 static void
-parse_accessor(Eo_Lexer *ls, Eo_Property_Def *prop)
+parse_accessor(Eo_Lexer *ls, Eolian_Function *prop)
 {
    int line, col;
    Eina_Bool has_return = EINA_FALSE, has_legacy = EINA_FALSE,
@@ -1231,10 +1231,11 @@ parse_accessor(Eo_Lexer *ls, Eo_Property_Def *prop)
    Eina_Bool is_get = (ls->t.kw == KW_get);
    if (is_get)
      {
+        if (prop->base.file)
+          eina_stringshare_del(prop->base.file);
         prop->base.file = eina_stringshare_ref(ls->filename);
         prop->base.line = ls->line_number;
         prop->base.column = ls->column;
-        prop->get_accessor = EINA_TRUE;
         if (prop->type == EOLIAN_PROP_SET)
           prop->type = EOLIAN_PROPERTY;
         else
@@ -1245,7 +1246,6 @@ parse_accessor(Eo_Lexer *ls, Eo_Property_Def *prop)
         prop->set_base.file = eina_stringshare_ref(ls->filename);
         prop->set_base.line = ls->line_number;
         prop->set_base.column = ls->column;
-        prop->set_accessor = EINA_TRUE;
         if (prop->type == EOLIAN_PROP_GET)
           prop->type = EOLIAN_PROPERTY;
         else
@@ -1326,14 +1326,28 @@ parse_params(Eo_Lexer *ls, Eina_Bool allow_inout, 
Eina_Bool is_vals)
 }
 
 static void
+_interface_virtual_set(Eo_Lexer *ls, Eolian_Function *foo_id)
+{
+   if (ls->tmp.kls->type != EOLIAN_CLASS_INTERFACE)
+     return;
+
+   if (foo_id->type == EOLIAN_PROP_GET)
+     foo_id->get_virtual_pure = EINA_TRUE;
+   else if (foo_id->type == EOLIAN_PROP_SET)
+     foo_id->set_virtual_pure = EINA_TRUE;
+   if (foo_id->type == EOLIAN_PROPERTY)
+     foo_id->get_virtual_pure = foo_id->set_virtual_pure = EINA_TRUE;
+}
+
+static void
 parse_property(Eo_Lexer *ls)
 {
    int line, col;
-   Eo_Property_Def *prop = NULL;
+   Eolian_Function *prop = NULL;
    Eina_Bool has_get       = EINA_FALSE, has_set    = EINA_FALSE,
              has_keys      = EINA_FALSE, has_values = EINA_FALSE,
              has_protected = EINA_FALSE, has_class  = EINA_FALSE;
-   prop = calloc(1, sizeof(Eo_Property_Def));
+   prop = calloc(1, sizeof(Eolian_Function));
    prop->base.file = eina_stringshare_ref(ls->filename);
    prop->base.line = ls->line_number;
    prop->base.column = ls->column;
@@ -1394,6 +1408,7 @@ end:
    check_match(ls, '}', '{', line, col);
    if (!has_get && !has_set)
      prop->type = EOLIAN_PROPERTY;
+   _interface_virtual_set(ls, prop);
 }
 
 static void

-- 


Reply via email to