summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-04 14:29:13 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-04 16:29:14 +0100
commitfca272222d80bbbd57d3704181ba4d263b2dff99 (patch)
tree0e004dedfd8467cb0b25b60f49a045478f2b4660
parent78490e40fd4cd8b9838bba95fd5dd42792393e2d (diff)
downloadefl-fca272222d80bbbd57d3704181ba4d263b2dff99.tar.gz
eolian: provide line info structure in each eolian handle
-rw-r--r--src/lib/eolian/database_fill.c18
-rw-r--r--src/lib/eolian/eo_definitions.h5
-rw-r--r--src/lib/eolian/eolian_database.h16
3 files changed, 37 insertions, 2 deletions
diff --git a/src/lib/eolian/database_fill.c b/src/lib/eolian/database_fill.c
index 24f8e3ea02..d75737eb71 100644
--- a/src/lib/eolian/database_fill.c
+++ b/src/lib/eolian/database_fill.c
@@ -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;
}
diff --git a/src/lib/eolian/eo_definitions.h b/src/lib/eolian/eo_definitions.h
index 94a043f0c7..dc52ab049d 100644
--- a/src/lib/eolian/eo_definitions.h
+++ b/src/lib/eolian/eo_definitions.h
@@ -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;
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index e851039617..4e175b9851 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -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;