summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-11-27 03:37:12 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-27 03:37:12 +0100
commit984f10907bc03d4559236bdeba86e5b9b26a2499 (patch)
tree3edebab9c0ad23bd0acf6ef417c896616b3caec4
parent21fc53f1e7e9403a6d488e3b6ae9f1a8492a318c (diff)
downloadeo_tokenizer-984f10907bc03d4559236bdeba86e5b9b26a2499.zip
eo_tokenizer-984f10907bc03d4559236bdeba86e5b9b26a2499.tar.gz
add Eo_Accessor_Def
a property has a name, parameters and accessors
-rw-r--r--eo_tokenizer.h17
-rw-r--r--eo_tokenizer.rl25
2 files changed, 33 insertions, 9 deletions
diff --git a/eo_tokenizer.h b/eo_tokenizer.h
index eb618b9..646dd45 100644
--- a/eo_tokenizer.h
+++ b/eo_tokenizer.h
@@ -60,20 +60,26 @@ typedef struct _eo_param_def
/* PROPERTIES */
-typedef enum _property_type
+typedef enum _eo_accessor_type
{
SETTER,
GETTER,
PROP_TYPE_LAST
-} Property_Type;
+} Eo_Accessor_Type;
-typedef struct _eo_property_def
+typedef struct _eo_accessor_def
{
- Property_Type type;
+ Eo_Accessor_Type type;
Eo_Ret_Def ret;
- const char *name;
const char *comment;
+ Eina_List *legacies;
+} Eo_Accessor_Def;
+
+typedef struct _eo_property_def
+{
+ const char *name;
Eina_List *params;
+ Eina_List *accessors;
} Eo_Property_Def;
/* METHODS */
@@ -130,6 +136,7 @@ typedef struct _eo_tokenizer
Eo_Property_Def *prop;
Eo_Method_Def *meth;
Eo_Param_Def *param;
+ Eo_Accessor_Def *accessor;
} tmp;
} Eo_Tokenizer;
diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl
index aebf832..ee66d05 100644
--- a/eo_tokenizer.rl
+++ b/eo_tokenizer.rl
@@ -339,20 +339,37 @@ _eo_tokenizer_param_free(Eo_Param_Def *param)
}
static void
+_eo_tokenizer_accessor_free(Eo_Accessor_Def *accessor)
+{
+ const char *s;
+ Eina_List *l;
+
+ if (accessor->comment)
+ eina_stringshare_del(accessor->comment);
+
+ EINA_LIST_FOREACH(accessor->legacies, l, s)
+ if (s) eina_stringshare_del(s);
+
+ _eo_tokenizer_ret_free(&accessor->ret);
+
+ free(accessor);
+}
+
+static void
_eo_tokenizer_property_def_free(Eo_Property_Def *prop)
{
Eo_Param_Def *param;
-
- _eo_tokenizer_ret_free(&prop->ret);
+ Eo_Accessor_Def *accessor;
if (prop->name)
eina_stringshare_del(prop->name);
- if (prop->comment)
- eina_stringshare_del(prop->comment);
EINA_LIST_FREE(prop->params, param)
_eo_tokenizer_param_free(param);
+ EINA_LIST_FREE(prop->accessors, accessor)
+ _eo_tokenizer_accessor_free(accessor);
+
free(prop);
}