summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-03 11:11:12 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-03 11:11:12 +0100
commita6fbe7b6a5cc2be2a5bef3fac104161a16ca41ce (patch)
treecc27ae9357f534a827bc6291c682e507154b5686
parent25822405a4ba2e20d770eea37808fb6a7465836e (diff)
eolian: preliminary parsing of doc syntax
-rw-r--r--src/lib/eolian/eo_parser.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 6a34d2c90c..ea1314caf7 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -481,6 +481,7 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
481 def->comment = eina_stringshare_ref(ls->t.value.s); 481 def->comment = eina_stringshare_ref(ls->t.value.s);
482 eo_lexer_get(ls); 482 eo_lexer_get(ls);
483 } 483 }
484 test_next(ls, TOK_DOC);
484 while (ls->t.token != '}') 485 while (ls->t.token != '}')
485 { 486 {
486 const char *fname; 487 const char *fname;
@@ -507,6 +508,7 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
507 fdef->comment = eina_stringshare_ref(ls->t.value.s); 508 fdef->comment = eina_stringshare_ref(ls->t.value.s);
508 eo_lexer_get(ls); 509 eo_lexer_get(ls);
509 } 510 }
511 test_next(ls, TOK_DOC);
510 } 512 }
511 check_match(ls, '}', '{', bline, bcolumn); 513 check_match(ls, '}', '{', bline, bcolumn);
512 FILL_BASE(def->base, ls, line, column); 514 FILL_BASE(def->base, ls, line, column);
@@ -540,6 +542,7 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
540 def->comment = eina_stringshare_ref(ls->t.value.s); 542 def->comment = eina_stringshare_ref(ls->t.value.s);
541 eo_lexer_get(ls); 543 eo_lexer_get(ls);
542 } 544 }
545 test_next(ls, TOK_DOC);
543 if (ls->t.token == TOK_VALUE && ls->t.kw == KW_legacy) 546 if (ls->t.token == TOK_VALUE && ls->t.kw == KW_legacy)
544 { 547 {
545 if (eo_lexer_lookahead(ls) == ':') 548 if (eo_lexer_lookahead(ls) == ':')
@@ -624,6 +627,7 @@ parse_enum(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
624 fdef->comment = eina_stringshare_ref(ls->t.value.s); 627 fdef->comment = eina_stringshare_ref(ls->t.value.s);
625 eo_lexer_get(ls); 628 eo_lexer_get(ls);
626 } 629 }
630 test_next(ls, TOK_DOC);
627 if (!want_next) 631 if (!want_next)
628 break; 632 break;
629 } 633 }
@@ -882,6 +886,7 @@ parse_typedef(Eo_Lexer *ls)
882 def->comment = eina_stringshare_ref(ls->t.value.s); 886 def->comment = eina_stringshare_ref(ls->t.value.s);
883 eo_lexer_get(ls); 887 eo_lexer_get(ls);
884 } 888 }
889 test_next(ls, TOK_DOC);
885 return def; 890 return def;
886} 891}
887 892
@@ -933,6 +938,7 @@ parse_variable(Eo_Lexer *ls, Eina_Bool global)
933 def->comment = eina_stringshare_ref(ls->t.value.s); 938 def->comment = eina_stringshare_ref(ls->t.value.s);
934 eo_lexer_get(ls); 939 eo_lexer_get(ls);
935 } 940 }
941 test_next(ls, TOK_DOC);
936 return def; 942 return def;
937} 943}
938 944
@@ -976,6 +982,7 @@ parse_return(Eo_Lexer *ls, Eo_Ret_Def *ret, Eina_Bool allow_void)
976 ret->comment = eina_stringshare_ref(ls->t.value.s); 982 ret->comment = eina_stringshare_ref(ls->t.value.s);
977 eo_lexer_get(ls); 983 eo_lexer_get(ls);
978 } 984 }
985 test_next(ls, TOK_DOC);
979} 986}
980 987
981static void 988static void
@@ -1057,6 +1064,7 @@ end:
1057 par->description = eina_stringshare_ref(ls->t.value.s); 1064 par->description = eina_stringshare_ref(ls->t.value.s);
1058 eo_lexer_get(ls); 1065 eo_lexer_get(ls);
1059 } 1066 }
1067 test_next(ls, TOK_DOC);
1060} 1068}
1061 1069
1062static void 1070static void
@@ -1121,6 +1129,7 @@ parse_accessor(Eo_Lexer *ls, Eolian_Function *prop)
1121 prop->set_description = eina_stringshare_ref(ls->t.value.s); 1129 prop->set_description = eina_stringshare_ref(ls->t.value.s);
1122 eo_lexer_get(ls); 1130 eo_lexer_get(ls);
1123 } 1131 }
1132 test_next(ls, TOK_DOC);
1124 for (;;) switch (ls->t.kw) 1133 for (;;) switch (ls->t.kw)
1125 { 1134 {
1126 case KW_return: 1135 case KW_return:
@@ -1250,6 +1259,7 @@ body:
1250 prop->common_description = eina_stringshare_ref(ls->t.value.s); 1259 prop->common_description = eina_stringshare_ref(ls->t.value.s);
1251 eo_lexer_get(ls); 1260 eo_lexer_get(ls);
1252 } 1261 }
1262 test_next(ls, TOK_DOC);
1253 for (;;) switch (ls->t.kw) 1263 for (;;) switch (ls->t.kw)
1254 { 1264 {
1255 case KW_get: 1265 case KW_get:
@@ -1335,6 +1345,7 @@ body:
1335 meth->common_description = eina_stringshare_ref(ls->t.value.s); 1345 meth->common_description = eina_stringshare_ref(ls->t.value.s);
1336 eo_lexer_get(ls); 1346 eo_lexer_get(ls);
1337 } 1347 }
1348 test_next(ls, TOK_DOC);
1338 for (;;) switch (ls->t.kw) 1349 for (;;) switch (ls->t.kw)
1339 { 1350 {
1340 case KW_return: 1351 case KW_return:
@@ -1587,6 +1598,7 @@ parse_event(Eo_Lexer *ls)
1587 ev->comment = eina_stringshare_ref(ls->t.value.s); 1598 ev->comment = eina_stringshare_ref(ls->t.value.s);
1588 eo_lexer_get(ls); 1599 eo_lexer_get(ls);
1589 } 1600 }
1601 test_next(ls, TOK_DOC);
1590 ev->klass = ls->tmp.kls; 1602 ev->klass = ls->tmp.kls;
1591} 1603}
1592 1604
@@ -1663,6 +1675,7 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type)
1663 ls->tmp.kls->description = eina_stringshare_ref(ls->t.value.s); 1675 ls->tmp.kls->description = eina_stringshare_ref(ls->t.value.s);
1664 eo_lexer_get(ls); 1676 eo_lexer_get(ls);
1665 } 1677 }
1678 test_next(ls, TOK_DOC);
1666 if (type == EOLIAN_CLASS_INTERFACE) 1679 if (type == EOLIAN_CLASS_INTERFACE)
1667 { 1680 {
1668 ls->tmp.kls->data_type = eina_stringshare_add("null"); 1681 ls->tmp.kls->data_type = eina_stringshare_add("null");
@@ -1931,6 +1944,7 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
1931 def->comment = eina_stringshare_ref(ls->t.value.s); 1944 def->comment = eina_stringshare_ref(ls->t.value.s);
1932 eo_lexer_get(ls); 1945 eo_lexer_get(ls);
1933 } 1946 }
1947 test_next(ls, TOK_DOC);
1934 FILL_BASE(def->base, ls, line, col); 1948 FILL_BASE(def->base, ls, line, col);
1935 database_struct_add(def); 1949 database_struct_add(def);
1936 pop_type(ls); 1950 pop_type(ls);