summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-10-31 12:10:59 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-10-31 12:15:23 +0100
commit0a92c0c61fd8ed6dc853f4ba4ec7d9271c1a4caa (patch)
tree60a2343ab16bf2f7b651006c37a12e3ec59dc48b /src
parent130052f2751067bb8c7d6501619fe07dcf57178a (diff)
eolian: fill parts into db
Diffstat (limited to 'src')
-rw-r--r--src/lib/eolian/eo_parser.c36
-rw-r--r--src/lib/eolian/eolian_database.h14
2 files changed, 40 insertions, 10 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index aa46dd95f1..2250ddaa01 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -1482,14 +1482,42 @@ end:
1482static void 1482static void
1483parse_part(Eo_Lexer *ls) 1483parse_part(Eo_Lexer *ls)
1484{ 1484{
1485 check_next(ls, TOK_VALUE); 1485 Eolian_Part *part = calloc(1, sizeof(Eolian_Part));
1486 ls->tmp.kls->parts = eina_list_append(ls->tmp.kls->parts, part);
1487 check(ls, TOK_VALUE);
1488 part->name = eina_stringshare_ref(ls->t.value.s);
1489 eo_lexer_get(ls);
1486 check_next(ls, ':'); 1490 check_next(ls, ':');
1487 Eina_Strbuf *buf = push_strbuf(ls); 1491 Eina_Strbuf *buf = push_strbuf(ls);
1492 eo_lexer_context_push(ls);
1488 parse_name(ls, buf); 1493 parse_name(ls, buf);
1489 check_next(ls, ';'); 1494 const char *nm = eina_strbuf_string_get(buf);
1490 if (ls->t.token == TOK_DOC) 1495 const char *bnm = eina_stringshare_ref(ls->filename);
1491 eo_lexer_get(ls); 1496 char *fnm = database_class_to_filename(nm);
1497 if (!compare_class_file(bnm, fnm))
1498 {
1499 const char *fname = eina_hash_find(_filenames, fnm);
1500 eina_stringshare_del(bnm);
1501 free(fnm);
1502 if (fname)
1503 _parse_dep(ls, fname, nm);
1504 /* FIXME: pass unit properly */
1505 Eolian_Class *dep = (Eolian_Class *)eolian_class_get_by_name(NULL, nm);
1506 if (!dep)
1507 {
1508 char ebuf[PATH_MAX];
1509 eo_lexer_context_restore(ls);
1510 snprintf(ebuf, sizeof(ebuf), "unknown class '%s'", nm);
1511 eo_lexer_syntax_error(ls, ebuf);
1512 return;
1513 }
1514 part->klass = dep;
1515 }
1516 else
1517 part->klass = ls->tmp.kls;
1492 pop_strbuf(ls); 1518 pop_strbuf(ls);
1519 check_next(ls, ';');
1520 FILL_DOC(ls, part, doc);
1493} 1521}
1494 1522
1495static void 1523static void
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index ae53ff94cb..7d134d4282 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -91,12 +91,13 @@ struct _Eolian_Class
91 Eina_Stringshare *eo_prefix; 91 Eina_Stringshare *eo_prefix;
92 Eina_Stringshare *ev_prefix; 92 Eina_Stringshare *ev_prefix;
93 Eina_Stringshare *data_type; 93 Eina_Stringshare *data_type;
94 Eina_List *inherits; /* List Eolian_Class * */ 94 Eina_List *inherits; /* Eolian_Class */
95 Eina_List *properties; /* List prop_name -> Eolian_Function */ 95 Eina_List *properties; /* Eolian_Function */
96 Eina_List *methods; /* List meth_name -> Eolian_Function */ 96 Eina_List *methods; /* Eolian_Function */
97 Eina_List *implements; /* List implements name -> Eolian_Implement */ 97 Eina_List *implements; /* Eolian_Implement */
98 Eina_List *constructors; /* List constructors name -> Eolian_Constructor */ 98 Eina_List *constructors; /* Eolian_Constructor */
99 Eina_List *events; /* List event_name -> Eolian_Event */ 99 Eina_List *events; /* Eolian_Event */
100 Eina_List *parts; /* Eolian_Part */
100 Eina_Bool class_ctor_enable:1; 101 Eina_Bool class_ctor_enable:1;
101 Eina_Bool class_dtor_enable:1; 102 Eina_Bool class_dtor_enable:1;
102 Eina_Bool toplevel:1; 103 Eina_Bool toplevel:1;
@@ -146,6 +147,7 @@ struct _Eolian_Part
146 Eolian_Object base; 147 Eolian_Object base;
147 Eina_Stringshare *name; 148 Eina_Stringshare *name;
148 Eolian_Class *klass; 149 Eolian_Class *klass;
150 Eolian_Documentation *doc;
149}; 151};
150 152
151struct _Eolian_Function_Parameter 153struct _Eolian_Function_Parameter