eolian: provide line info structure in each eolian handle
authorDaniel Kolesa <d.kolesa@samsung.com>
Mon, 4 Aug 2014 13:29:13 +0000 (14:29 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Thu, 21 Aug 2014 08:26:03 +0000 (09:26 +0100)
src/lib/eolian/database_fill.c
src/lib/eolian/eo_definitions.h
src/lib/eolian/eolian_database.h

index 24f8e3e..d75737e 100644 (file)
@@ -25,6 +25,8 @@ _db_fill_ctor(Eolian_Class *cl, Eo_Method_Def *meth)
         param->type = NULL;
      }
 
+   foo_id->base = meth->base;
+
    return EINA_TRUE;
 }
 
@@ -51,6 +53,8 @@ _db_fill_key(Eolian_Function *foo_id, Eo_Param_Def *param)
    database_parameter_nonull_set(p, param->nonull);
    param->type = NULL;
 
+   p->base = param->base;
+
    return EINA_TRUE;
 }
 
@@ -76,6 +80,8 @@ _db_fill_value(Eolian_Function *foo_id, Eo_Param_Def *param)
    database_parameter_nonull_set(p, param->nonull);
    param->type = NULL;
 
+   p->base = param->base;
+
    return EINA_TRUE;
 }
 
@@ -102,6 +108,8 @@ _db_fill_param(Eolian_Function *foo_id, Eo_Param_Def *param)
    database_parameter_nonull_set(p, param->nonull);
    param->type = NULL;
 
+   p->base = param->base;
+
    return EINA_TRUE;
 }
 
@@ -177,6 +185,11 @@ _db_fill_accessor(Eolian_Function *foo_id, Eo_Class_Def *kls,
    if (kls->type == EOLIAN_CLASS_INTERFACE)
       database_function_set_as_virtual_pure(foo_id, ftype);
 
+   if (ftype == EOLIAN_PROP_GET)
+     foo_id->base = accessor->base;
+   else
+     foo_id->set_base = accessor->base;
+
    return EINA_TRUE;
 }
 
@@ -212,6 +225,7 @@ _db_fill_property(Eolian_Class *cl, Eo_Class_Def *kls, Eo_Property_Def *prop)
         database_function_type_set(foo_id, EOLIAN_PROPERTY);
         if (kls->type == EOLIAN_CLASS_INTERFACE)
           database_function_set_as_virtual_pure(foo_id, EOLIAN_UNRESOLVED);
+        foo_id->base = prop->base;
      }
 
    database_class_function_add(cl, foo_id);
@@ -267,6 +281,8 @@ _db_fill_method(Eolian_Class *cl, Eo_Class_Def *kls, Eo_Method_Def *meth)
    if (kls->type == EOLIAN_CLASS_INTERFACE)
      database_function_set_as_virtual_pure(foo_id, EOLIAN_METHOD);
 
+   foo_id->base = meth->base;
+
    return EINA_TRUE;
 }
 
@@ -409,6 +425,8 @@ _db_fill_class(Eo_Class_Def *kls)
    if (!_db_fill_implements(cl, kls)) return EINA_FALSE;
    if (!_db_fill_events    (cl, kls)) return EINA_FALSE;
 
+   cl->base = kls->base;
+
    return EINA_TRUE;
 }
 
index 94a043f..dc52ab0 100644 (file)
@@ -20,6 +20,7 @@ typedef struct _Eo_Ret_Def
 
 typedef struct _Eo_Param_Def
 {
+   Eolian_Object base;
    Eolian_Parameter_Dir way;
    Eolian_Type *type;
    Eina_Stringshare *name;
@@ -43,6 +44,7 @@ typedef struct _Eo_Accessor_Param
 
 typedef struct _Eo_Accessor_Def
 {
+   Eolian_Object base;
    Eo_Accessor_Type type;
    Eo_Ret_Def *ret;
    Eina_Stringshare *comment;
@@ -54,6 +56,7 @@ typedef struct _Eo_Accessor_Def
 
 typedef struct _Eo_Property_Def
 {
+   Eolian_Object base;
    Eina_Stringshare *name;
    Eina_List *keys;
    Eina_List *values;
@@ -66,6 +69,7 @@ typedef struct _Eo_Property_Def
 
 typedef struct _Eo_Method_Def
 {
+   Eolian_Object base;
    Eo_Ret_Def *ret;
    Eina_Stringshare *name;
    Eina_Stringshare *comment;
@@ -80,6 +84,7 @@ typedef struct _Eo_Method_Def
 
 typedef struct _Eo_Class_Def
 {
+   Eolian_Object base;
    Eina_Stringshare *name;
    Eina_Stringshare *file;
    Eolian_Class_Type type;
index e851039..4e175b9 100644 (file)
@@ -48,8 +48,15 @@ extern Eina_Hash *_structsf;
 extern Eina_Hash *_filenames; /* Hash: filename without extension -> full path */
 extern Eina_Hash *_tfilenames;
 
+typedef struct _Eolian_Object
+{
+   int line;
+   int column;
+} Eolian_Object;
+
 struct _Eolian_Class
 {
+   Eolian_Object base;
    Eina_Stringshare *full_name;
    Eina_List *namespaces; /* List Eina_Stringshare * */
    Eina_Stringshare *name;
@@ -71,6 +78,8 @@ struct _Eolian_Class
 
 struct _Eolian_Function
 {
+   Eolian_Object base;
+   Eolian_Object set_base;
    Eina_Stringshare *name;
    Eina_List *keys; /* list of Eolian_Function_Parameter */
    Eina_List *params; /* list of Eolian_Function_Parameter */
@@ -89,6 +98,7 @@ struct _Eolian_Function
 
 struct _Eolian_Function_Parameter
 {
+   Eolian_Object base;
    Eina_Stringshare *name;
    Eolian_Type *type;
    Eina_Stringshare *description;
@@ -98,10 +108,9 @@ struct _Eolian_Function_Parameter
    Eina_Bool nonull :1; /* True if this argument cannot be NULL */
 };
 
-/* maps directly to Eo_Type_Def */
-
 struct _Eolian_Type
 {
+   Eolian_Object base;
    Eolian_Type_Type type;
    union {
       /* functions */
@@ -129,11 +138,13 @@ struct _Eolian_Type
 
 struct _Eolian_Implement
 {
+   Eolian_Object base;
    Eina_Stringshare *full_name;
 };
 
 struct _Eolian_Event
 {
+   Eolian_Object base;
    Eina_Stringshare *name;
    Eina_Stringshare *comment;
    Eolian_Type *type;
@@ -141,6 +152,7 @@ struct _Eolian_Event
 
 typedef struct _Eolian_Struct_Field
 {
+   Eolian_Object     base;
    Eolian_Type      *type;
    Eina_Stringshare *comment;
 } Eolian_Struct_Field;