diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-25 11:41:01 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-25 11:41:01 +0100 |
commit | 052b8c9cb9a4dd165d147477546d63ac08598fc6 (patch) | |
tree | df309917302fd8e78f700197abdf1bb3bf73baab | |
parent | fe6e01463b4b3c62b7efc9e523090202147d108d (diff) | |
download | eo_tokenizer-052b8c9cb9a4dd165d147477546d63ac08598fc6.zip eo_tokenizer-052b8c9cb9a4dd165d147477546d63ac08598fc6.tar.gz |
eo_tokenizer_dump() outputs tokenized definitions
-rw-r--r-- | eo_tokenizer.rl | 22 | ||||
-rw-r--r-- | main.c | 2 |
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 @@ -41,6 +41,8 @@ int main(int argc, char **argv) } eo_tokenizer_walk(toknz, fpath); + eo_tokenizer_dump(toknz); + eo_tokenizer_free(toknz); } |