aboutsummaryrefslogtreecommitdiffstats
path: root/eoparser/cparser.py
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-02-13 18:52:19 +0200
committerYakov Goldberg <yakov.g@samsung.com>2014-02-13 18:53:21 +0200
commit0c804192a54eed940e5cf465514a73fd38a3dc75 (patch)
treeee010a816a9ee633504ab90e476238c8243d9953 /eoparser/cparser.py
parenteo generation description added (diff)
downloadeo_bindings-0c804192a54eed940e5cf465514a73fd38a3dc75.tar.gz
fix regex, to allow bracket in event's comment
- force parsing of elm_layout.c and elm_widget.c before everything because there are signals descriptions - change filenames from "ElmButton.eo" to "elm_button.eo"
Diffstat (limited to 'eoparser/cparser.py')
-rw-r--r--eoparser/cparser.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/eoparser/cparser.py b/eoparser/cparser.py
index 488639f..fa735ed 100644
--- a/eoparser/cparser.py
+++ b/eoparser/cparser.py
@@ -34,6 +34,7 @@ class Cparser(object):
self.cl_incl = {}
self.eapi_func_ret_type_hash = {}
self.all_eo_funcs_hash = {}
+ self.sig_names_map_global = {}
self.outdir = ""
self.typedefs = {"Evas_Coord" : "int",
@@ -172,6 +173,7 @@ class Cparser(object):
sig_names_list = re.findall(reg, af)
for k, n in sig_names_list:
sig_names_map[k] = n
+ self.sig_names_map_global[k] = n
# looking for constructions like
# #define SIG_CLICKED "clicked"
@@ -180,6 +182,7 @@ class Cparser(object):
sig_names_list = re.findall(reg, af)
for k, n in sig_names_list:
sig_names_map[k] = n
+ self.sig_names_map_global[k] = n
#looking for Cb_Descriptions array, parse it
# and change SIG_ variables with it's defines...
@@ -201,7 +204,15 @@ class Cparser(object):
c = c.strip();
if v.find("\"") == -1 and v != "NULL":
- v = sig_names_map[v]
+ if v in sig_names_map:
+ v = sig_names_map[v]
+ else:
+ print "Looks like this signal %s is global"%(v)
+ if v in self.sig_names_map_global:
+ v = self.sig_names_map_global[v]
+ else:
+ print "%s was not find: exiting"%(v)
+ exit(1)
v = v.strip("\"")
c = c.strip("\"")
if v != "NULL":
@@ -254,11 +265,16 @@ class Cparser(object):
#FIXME: this regex must hande case when \" in inside quotes
#looking for declarations of all events, This can fail, if bracket is used inside
+ #
+ # Now this fail, if ; is inside of comment.
event_descriptions = {}
- reg = "Eo_Event_Description[ ]*([\w]*)[ =]*EO_(HOT_)*EVENT_DESCRIPTION\(([^\)]*)\);"
+ #reg = "Eo_Event_Description[ ]*([\w]*)[ =]*EO_(HOT_)*EVENT_DESCRIPTION\(([^\)]*)\);"
+
+ reg = "Eo_Event_Description[ ]*([\w]*)[ =]*EO_(HOT_)*EVENT_DESCRIPTION\(([^;]*);"
af = _in_data.replace("\n", "")
ev_list = re.findall(reg, af)
for key, hot, desc in ev_list:
+ desc = desc.strip(")").strip(" ")
event, comment = smart_split2(desc, "\"", "\"")
event = event.strip().strip("\"")
comment = comment.strip().strip("\"")
@@ -1163,7 +1179,8 @@ class Cparser(object):
ret[IMPLEMENTS] = []
ret[SIGNALS] = []
- self.cl_data[cl_id][const.XML_FILE] = os.path.join(self.outdir, normalize_names([self.cl_data[cl_id][const.C_NAME]])[0] + ".eo")
+ #self.cl_data[cl_id][const.XML_FILE] = os.path.join(self.outdir, normalize_names([self.cl_data[cl_id][const.C_NAME]])[0] + ".eo")
+ self.cl_data[cl_id][const.XML_FILE] = os.path.join(self.outdir, self.cl_data[cl_id][const.C_NAME].lower() + ".eo")
new_buf = ""