aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2013-10-30 16:25:16 +0200
committerYakov Goldberg <yakov.g@samsung.com>2013-10-30 17:34:31 +0200
commit60ec1904a939f2b7cc3341feeb43eafdcba421a2 (patch)
tree2970119244a8e42a6d80f43e4d991b23523a6cce
parentfix regex to match multiple quoted lines with quotes inside (diff)
downloadeo_bindings-60ec1904a939f2b7cc3341feeb43eafdcba421a2.tar.gz
add func to determine its type
-rw-r--r--eoparser/cparser.py45
1 files changed, 44 insertions, 1 deletions
diff --git a/eoparser/cparser.py b/eoparser/cparser.py
index 7231f37..f8914b9 100644
--- a/eoparser/cparser.py
+++ b/eoparser/cparser.py
@@ -428,7 +428,10 @@ class Cparser(object):
#looking for needed func
for op, func_name in class_data[const.OP_DESC]:
if op == impl_op_id:
- impl_funcs[impl_op_id] = (class_data[const.C_NAME], func_name)
+ tt = self.func_type(class_data[const.C_NAME], func_name)
+ if tt != const.METHOD:
+ func_name = func_name[:-4]
+ impl_funcs[impl_op_id] = (class_data[const.C_NAME], func_name, tt)
break;
break;
@@ -928,6 +931,46 @@ class Cparser(object):
f.write(res)
f.close()
+
+ def func_type(self, cl_name, func_name):
+ kl = None
+ for cl_id, data in self.cl_data.iteritems():
+ if data[const.C_NAME] == cl_name:
+ kl = data
+ break;
+
+ prefix = func_name[:-4]
+ postfix = func_name[-4:]
+
+ T = None
+ if postfix in ["_set", "_get"]:
+ if prefix + "_set" in kl[const.FUNCS] and prefix + "_get" in kl[const.FUNCS]:
+ T = const.SET_GET
+ for (n, m ,t1, d, c) in kl[const.FUNCS][prefix+"_set"][const.PARAMETERS]:
+ if d != "in":
+ T = const.METHOD
+
+ for (n, m ,t1, d, c) in kl[const.FUNCS][prefix+"_get"][const.PARAMETERS]:
+ if d != "out":
+ T = const.METHOD
+ elif prefix + "_set" in kl[const.FUNCS]:
+ T = const.SET_ONLY
+ for (n, m ,t1, d, c) in kl[const.FUNCS][prefix+"_set"][const.PARAMETERS]:
+ if d != "in":
+ T = const.METHOD
+
+ elif prefix + "_get" in kl[const.FUNCS]:
+ T = const.GET_ONLY
+ for (n, m ,t1, d, c) in kl[const.FUNCS][prefix+"_get"][const.PARAMETERS]:
+ if d != "out":
+ T = const.METHOD
+
+ elif func_name in kl[const.FUNCS]:
+ T = const.METHOD
+
+ return T
+
+
#generating Eo file in JSON
def build_eo2(self, cl_id):
ret = OrderedDict()