summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-29 11:40:29 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-29 11:40:29 +0100
commit3e5da03f7dd3b99e1c92ae4c73285cebebb37e18 (patch)
tree6ee79553dfb9adf65982e169ecdf2d14d827d254 /src/lib
parent19a6c265b6d598759a2b74340464b6f6beed838a (diff)
eolian: update virtual to the new syntax (as per wiki)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_audio/ecore_audio.eo10
-rw-r--r--src/lib/ecore_audio/ecore_audio_in.eo8
-rw-r--r--src/lib/ecore_con/ecore_con_base.eo20
-rw-r--r--src/lib/eolian/database_fill.c61
-rw-r--r--src/lib/eolian/eo_lexer.h8
-rw-r--r--src/lib/eolian/eo_parser.c21
-rw-r--r--src/lib/eolian/eolian_database.h5
-rw-r--r--src/lib/evas/canvas/evas_3d_object.eo4
8 files changed, 63 insertions, 74 deletions
diff --git a/src/lib/ecore_audio/ecore_audio.eo b/src/lib/ecore_audio/ecore_audio.eo
index fc62df2..1b61691 100644
--- a/src/lib/ecore_audio/ecore_audio.eo
+++ b/src/lib/ecore_audio/ecore_audio.eo
@@ -116,10 +116,10 @@ class Ecore_Audio (Eo.Base)
116 } 116 }
117 implements { 117 implements {
118 Eo.Base.constructor; 118 Eo.Base.constructor;
119 virtual.source.get; 119 @virtual .source.get;
120 virtual.source.set; 120 @virtual .source.set;
121 virtual.format.get; 121 @virtual .format.get;
122 virtual.format.set; 122 @virtual .format.set;
123 virtual.vio_set; 123 @virtual .vio_set;
124 } 124 }
125} 125}
diff --git a/src/lib/ecore_audio/ecore_audio_in.eo b/src/lib/ecore_audio/ecore_audio_in.eo
index cbf0ce8..5115771 100644
--- a/src/lib/ecore_audio/ecore_audio_in.eo
+++ b/src/lib/ecore_audio/ecore_audio_in.eo
@@ -176,10 +176,10 @@ class Ecore_Audio_In (Ecore_Audio)
176 Eo.Base.constructor; 176 Eo.Base.constructor;
177 Eo.Base.destructor; 177 Eo.Base.destructor;
178 Ecore_Audio.vio_set; 178 Ecore_Audio.vio_set;
179 virtual.preloaded.get; 179 @virtual .preloaded.get;
180 virtual.preloaded.set; 180 @virtual .preloaded.set;
181 virtual.seek; 181 @virtual .seek;
182 virtual.length.set; 182 @virtual .length.set;
183 } 183 }
184 events { 184 events {
185 in,looped; /*@ Called when an input has looped. */ 185 in,looped; /*@ Called when an input has looped. */
diff --git a/src/lib/ecore_con/ecore_con_base.eo b/src/lib/ecore_con/ecore_con_base.eo
index 7c75bff..e6eed1b 100644
--- a/src/lib/ecore_con/ecore_con_base.eo
+++ b/src/lib/ecore_con/ecore_con_base.eo
@@ -157,16 +157,16 @@ abstract Ecore.Con.Base (Eo.Base) {
157 } 157 }
158 } 158 }
159 implements { 159 implements {
160 virtual.ip.get; 160 @virtual .ip.get;
161 virtual.uptime.get; 161 @virtual .uptime.get;
162 virtual.port.set; 162 @virtual .port.set;
163 virtual.port.get; 163 @virtual .port.get;
164 virtual.fd.get; 164 @virtual .fd.get;
165 virtual.connected.get; 165 @virtual .connected.get;
166 virtual.timeout.set; 166 @virtual .timeout.set;
167 virtual.timeout.get; 167 @virtual .timeout.get;
168 virtual.flush; 168 @virtual .flush;
169 virtual.send; 169 @virtual .send;
170 } 170 }
171 events { 171 events {
172 data,received: Ecore_Con_Event_Data_Received; 172 data,received: Ecore_Con_Event_Data_Received;
diff --git a/src/lib/eolian/database_fill.c b/src/lib/eolian/database_fill.c
index 6210fc2..e9f3703 100644
--- a/src/lib/eolian/database_fill.c
+++ b/src/lib/eolian/database_fill.c
@@ -230,57 +230,46 @@ _db_fill_implement(Eolian_Class *cl, Eolian_Implement *impl)
230{ 230{
231 const char *impl_name = impl->full_name; 231 const char *impl_name = impl->full_name;
232 232
233 if (!strcmp(impl_name, "class.constructor")) 233 if (impl->is_virtual)
234 {
235 cl->class_ctor_enable = EINA_TRUE;
236 return 1;
237 }
238
239 if (!strcmp(impl_name, "class.destructor"))
240 {
241 cl->class_dtor_enable = EINA_TRUE;
242 return 1;
243 }
244
245 if (!strncmp(impl_name, "virtual.", 8))
246 { 234 {
247 Eolian_Function_Type ftype = EOLIAN_UNRESOLVED; 235 Eolian_Function_Type ftype = EOLIAN_UNRESOLVED;
248 char *type_as_str = NULL;
249 char *virtual_name = strdup(impl_name);
250 char *func = strchr(virtual_name, '.');
251
252 if (func) *func = '\0';
253 func += 1;
254 236
255 if ((type_as_str = strchr(func, '.'))) 237 if (impl->is_prop_get)
256 { 238 ftype = EOLIAN_PROP_GET;
257 *type_as_str = '\0'; 239 else if (impl->is_prop_set)
258 240 ftype = EOLIAN_PROP_SET;
259 if (!strcmp(type_as_str+1, "set")) 241 printf("name: %s\n", impl_name);
260 ftype = EOLIAN_PROP_SET;
261 else if (!strcmp(type_as_str+1, "get"))
262 ftype = EOLIAN_PROP_GET;
263 }
264 242
265 Eolian_Function *foo_id = (Eolian_Function*) 243 Eolian_Function *foo_id = (Eolian_Function*)
266 eolian_class_function_get_by_name(cl, 244 eolian_class_function_get_by_name(cl,
267 func, 245 impl_name,
268 ftype); 246 ftype);
269
270 free(virtual_name);
271
272 if (!foo_id) 247 if (!foo_id)
273 { 248 {
274 ERR("Error - %s not known in class %s", impl_name + 8, 249 ERR("Error - %s%s not known in class %s", impl_name,
275 eolian_class_name_get(cl)); 250 eolian_class_name_get(cl), (impl->is_prop_get ? ".get"
251 : (impl->is_prop_set ? ".set" : "")));
276 return -1; 252 return -1;
277 } 253 }
278 if (ftype == EOLIAN_PROP_SET) 254
255 if (impl->is_prop_set)
279 foo_id->set_virtual_pure = EINA_TRUE; 256 foo_id->set_virtual_pure = EINA_TRUE;
280 else 257 else
281 foo_id->get_virtual_pure = EINA_TRUE; 258 foo_id->get_virtual_pure = EINA_TRUE;
259
282 return 1; 260 return 1;
283 } 261 }
262 else if (impl->is_class_ctor)
263 {
264 cl->class_ctor_enable = EINA_TRUE;
265 return 1;
266 }
267 else if (impl->is_class_dtor)
268 {
269 cl->class_dtor_enable = EINA_TRUE;
270 return 1;
271 }
272
284 cl->implements = eina_list_append(cl->implements, impl); 273 cl->implements = eina_list_append(cl->implements, impl);
285 return 0; 274 return 0;
286} 275}
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index 5530178..432cef8 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -22,15 +22,15 @@ enum Tokens
22/* all keywords in eolian, they can still be used as names (they're TOK_VALUE) 22/* all keywords in eolian, they can still be used as names (they're TOK_VALUE)
23 * they just fill in the "kw" field of the token */ 23 * they just fill in the "kw" field of the token */
24#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \ 24#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \
25 KW(virtual), \
26 \ 25 \
27 KW(abstract), KW(constructor), KW(data), KW(destructor), KW(eo), \ 26 KW(abstract), KW(constructor), KW(data), KW(destructor), KW(eo), \
28 KW(eo_prefix), KW(events), KW(free), KW(func), KW(get), KW(implements), \ 27 KW(eo_prefix), KW(events), KW(free), KW(func), KW(get), KW(implements), \
29 KW(interface), KW(keys), KW(legacy), KW(legacy_prefix), KW(methods), \ 28 KW(interface), KW(keys), KW(legacy), KW(legacy_prefix), KW(methods), \
30 KW(mixin), KW(own), KW(params), KW(properties), KW(set), KW(type), \ 29 KW(mixin), KW(own), KW(params), KW(properties), KW(set), KW(type), \
31 KW(values), KW(var), KWAT(class), KWAT(const), KWAT(constructor), \ 30 KW(values), KW(var), KWAT(auto), KWAT(class), KWAT(const), \
32 KWAT(extern), KWAT(free), KWAT(in), KWAT(inout), KWAT(nonull), KWAT(out), \ 31 KWAT(constructor), KWAT(empty), KWAT(extern), KWAT(free), KWAT(in), \
33 KWAT(private), KWAT(protected), KWAT(warn_unused), \ 32 KWAT(inout), KWAT(nonull), KWAT(out), KWAT(private), KWAT(protected), \
33 KWAT(virtual), KWAT(warn_unused), \
34 \ 34 \
35 KW(byte), KW(ubyte), KW(char), KW(short), KW(ushort), KW(int), KW(uint), \ 35 KW(byte), KW(ubyte), KW(char), KW(short), KW(ushort), KW(int), KW(uint), \
36 KW(long), KW(ulong), KW(llong), KW(ullong), \ 36 KW(long), KW(ulong), KW(llong), KW(ullong), \
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 76f0cf5..6b03a08 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -1481,7 +1481,6 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface)
1481{ 1481{
1482 Eina_Strbuf *buf = NULL; 1482 Eina_Strbuf *buf = NULL;
1483 Eolian_Implement *impl = NULL; 1483 Eolian_Implement *impl = NULL;
1484 buf = push_strbuf(ls);
1485 impl = calloc(1, sizeof(Eolian_Implement)); 1484 impl = calloc(1, sizeof(Eolian_Implement));
1486 impl->base.file = eina_stringshare_ref(ls->filename); 1485 impl->base.file = eina_stringshare_ref(ls->filename);
1487 impl->base.line = ls->line_number; 1486 impl->base.line = ls->line_number;
@@ -1491,54 +1490,50 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface)
1491 check_kw(ls, KW_class); 1490 check_kw(ls, KW_class);
1492 if (ls->t.kw == KW_class) 1491 if (ls->t.kw == KW_class)
1493 { 1492 {
1494 eina_strbuf_append(buf, "class.");
1495 eo_lexer_get(ls); 1493 eo_lexer_get(ls);
1496 check_next(ls, '.'); 1494 check_next(ls, '.');
1497 if (ls->t.kw == KW_destructor) 1495 if (ls->t.kw == KW_destructor)
1498 { 1496 {
1499 eina_strbuf_append(buf, "destructor"); 1497 impl->is_class_dtor = EINA_TRUE;
1500 eo_lexer_get(ls); 1498 eo_lexer_get(ls);
1501 } 1499 }
1502 else 1500 else
1503 { 1501 {
1504 check_kw_next(ls, KW_constructor); 1502 check_kw_next(ls, KW_constructor);
1505 eina_strbuf_append(buf, "constructor"); 1503 impl->is_class_ctor = EINA_TRUE;
1506 } 1504 }
1507 check_next(ls, ';'); 1505 check_next(ls, ';');
1508 impl->full_name = eina_stringshare_add(eina_strbuf_string_get(buf));
1509 pop_strbuf(ls);
1510 return; 1506 return;
1511 } 1507 }
1512 else if (ls->t.kw == KW_virtual) 1508 else if (ls->t.kw == KW_at_virtual)
1513 { 1509 {
1514 eina_strbuf_append(buf, "virtual."); 1510 impl->is_virtual = EINA_TRUE;
1515 eo_lexer_get(ls); 1511 eo_lexer_get(ls);
1516 check_next(ls, '.'); 1512 check_next(ls, '.');
1517 if ((ls->t.token != TOK_VALUE) || (ls->t.kw == KW_get || ls->t.kw == KW_set)) 1513 if ((ls->t.token != TOK_VALUE) || (ls->t.kw == KW_get || ls->t.kw == KW_set))
1518 eo_lexer_syntax_error(ls, "name expected"); 1514 eo_lexer_syntax_error(ls, "name expected");
1519 eina_strbuf_append(buf, ls->t.value.s); 1515 impl->full_name = eina_stringshare_add(ls->t.value.s);
1520 eo_lexer_get(ls); 1516 eo_lexer_get(ls);
1521 if (ls->t.token == '.') 1517 if (ls->t.token == '.')
1522 { 1518 {
1523 eo_lexer_get(ls); 1519 eo_lexer_get(ls);
1524 if (ls->t.kw == KW_set) 1520 if (ls->t.kw == KW_set)
1525 { 1521 {
1526 eina_strbuf_append(buf, ".set"); 1522 impl->is_prop_set = EINA_TRUE;
1527 eo_lexer_get(ls); 1523 eo_lexer_get(ls);
1528 } 1524 }
1529 else 1525 else
1530 { 1526 {
1531 check_kw_next(ls, KW_get); 1527 check_kw_next(ls, KW_get);
1532 eina_strbuf_append(buf, ".get"); 1528 impl->is_prop_get = EINA_TRUE;
1533 } 1529 }
1534 } 1530 }
1535 check_next(ls, ';'); 1531 check_next(ls, ';');
1536 impl->full_name = eina_stringshare_add(eina_strbuf_string_get(buf));
1537 pop_strbuf(ls);
1538 return; 1532 return;
1539 } 1533 }
1540 if ((ls->t.token != TOK_VALUE) || (ls->t.kw == KW_get || ls->t.kw == KW_set)) 1534 if ((ls->t.token != TOK_VALUE) || (ls->t.kw == KW_get || ls->t.kw == KW_set))
1541 eo_lexer_syntax_error(ls, "class name expected"); 1535 eo_lexer_syntax_error(ls, "class name expected");
1536 buf = push_strbuf(ls);
1542 eina_strbuf_append(buf, ls->t.value.s); 1537 eina_strbuf_append(buf, ls->t.value.s);
1543 eo_lexer_get(ls); 1538 eo_lexer_get(ls);
1544 check_next(ls, '.'); 1539 check_next(ls, '.');
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index ae30521..d098493 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -159,6 +159,11 @@ struct _Eolian_Implement
159 Eolian_Object base; 159 Eolian_Object base;
160 const Eolian_Class *klass; 160 const Eolian_Class *klass;
161 Eina_Stringshare *full_name; 161 Eina_Stringshare *full_name;
162 Eina_Bool is_virtual :1;
163 Eina_Bool is_prop_get :1;
164 Eina_Bool is_prop_set :1;
165 Eina_Bool is_class_ctor :1;
166 Eina_Bool is_class_dtor :1;
162}; 167};
163 168
164struct _Eolian_Event 169struct _Eolian_Event
diff --git a/src/lib/evas/canvas/evas_3d_object.eo b/src/lib/evas/canvas/evas_3d_object.eo
index b15ba6a..6202f60 100644
--- a/src/lib/evas/canvas/evas_3d_object.eo
+++ b/src/lib/evas/canvas/evas_3d_object.eo
@@ -65,8 +65,8 @@ class Evas_3D_Object (Eo.Base, Evas.Common_Interface)
65 implements { 65 implements {
66 Eo.Base.constructor; 66 Eo.Base.constructor;
67 Evas.Common_Interface.evas.get; 67 Evas.Common_Interface.evas.get;
68 virtual.update_notify; 68 @virtual .update_notify;
69 virtual.change_notify; 69 @virtual .change_notify;
70 } 70 }
71 71
72} 72}