summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-11-25 11:41:01 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-25 11:41:01 +0100
commit052b8c9cb9a4dd165d147477546d63ac08598fc6 (patch)
treedf309917302fd8e78f700197abdf1bb3bf73baab
parentfe6e01463b4b3c62b7efc9e523090202147d108d (diff)
downloadeo_tokenizer-052b8c9cb9a4dd165d147477546d63ac08598fc6.zip
eo_tokenizer-052b8c9cb9a4dd165d147477546d63ac08598fc6.tar.gz
eo_tokenizer_dump() outputs tokenized definitions
-rw-r--r--eo_tokenizer.rl22
-rw-r--r--main.c2
2 files changed, 19 insertions, 5 deletions
diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl
index bd740b2..1f98b89 100644
--- a/eo_tokenizer.rl
+++ b/eo_tokenizer.rl
@@ -13,7 +13,10 @@ _eo_tokenizer_abort(Eo_Tokenizer *toknz,
eina_log_vprint(_eo_tokenizer_log_dom, EINA_LOG_LEVEL_ERR,
file, fct, line, fmt, ap);
va_end(ap);
- eo_tokenizer_dump(toknz);
+ fprintf(stderr, " toknz[%d] n:%d l:%d p:%d pe:%d ts:%d te:%d act:%d\n",
+ toknz->cs, toknz->current_nesting, toknz->current_line,
+ (toknz->p - toknz->buf), (toknz->pe - toknz->buf),
+ toknz->ts, toknz->te, toknz->act);
exit(EXIT_FAILURE);
}
#define ABORT(toknz, ...) \
@@ -274,10 +277,19 @@ eo_tokenizer_get(void)
void
eo_tokenizer_dump(Eo_Tokenizer *toknz)
{
- fprintf(stderr, " toknz[%d] n:%d l:%d p:%d pe:%d ts:%d te:%d act:%d\n",
- toknz->cs, toknz->current_nesting, toknz->current_line,
- (toknz->p - toknz->buf), (toknz->pe - toknz->buf),
- toknz->ts, toknz->te, toknz->act);
+ const char *s;
+ Eina_List *k, *l;
+ Eo_Class_Def *kls;
+
+ EINA_LIST_FOREACH(toknz->classes, k, kls)
+ {
+ printf("Class: %s\n", kls->name);
+ printf(" inherits from :");
+ EINA_LIST_FOREACH(kls->inherits, l, s)
+ printf(" %s", s);
+ printf("\n");
+ }
+
}
void
diff --git a/main.c b/main.c
index a45a32f..5dff237 100644
--- a/main.c
+++ b/main.c
@@ -41,6 +41,8 @@ int main(int argc, char **argv)
}
eo_tokenizer_walk(toknz, fpath);
+ eo_tokenizer_dump(toknz);
+
eo_tokenizer_free(toknz);
}