diff options
author | midipix <writeonce@midipix.org> | 2016-01-08 17:20:59 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-01-09 05:32:50 -0500 |
commit | f2e43d1d66a6455febcf06fd740d2369f296954c (patch) | |
tree | a7e5676d18fa0266b270737035479c7b7ee3c7b4 /src/driver/amgc_driver_ctx.c | |
parent | 43b7a222c0944f84a077f0a58d9566530630def2 (diff) | |
download | apimagic-f2e43d1d66a6455febcf06fd740d2369f296954c.tar.bz2 apimagic-f2e43d1d66a6455febcf06fd740d2369f296954c.tar.xz |
driver: --print-typedefs: initial implementation.
Diffstat (limited to 'src/driver/amgc_driver_ctx.c')
-rw-r--r-- | src/driver/amgc_driver_ctx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/driver/amgc_driver_ctx.c b/src/driver/amgc_driver_ctx.c index 2b33de4..1e92e74 100644 --- a/src/driver/amgc_driver_ctx.c +++ b/src/driver/amgc_driver_ctx.c @@ -8,6 +8,7 @@ #include <unistd.h> #include <fcntl.h> +#include <cparser/ast/type_t.h> #include <cparser/driver/c_driver.h> #include <cparser/driver/driver.h> #include <cparser/driver/driver_t.h> @@ -202,6 +203,14 @@ int amgc_get_driver_ctx( ctx->actions[nactions].type = AMGC_ACTION_OUTPUT; ctx->actions[nactions++].action = AMGC_LIST_ENUM; break; + + case TAG_PRINT_TYPEDEFS: + ctx->actions[nactions].type = AMGC_ACTION_OUTPUT; + ctx->actions[nactions].action = AMGC_OUTPUT_TYPEDEF; + + if (!strcmp("primary",entry->arg)) + ctx->actions[nactions++].subset = TYPE_ATOMIC; + break; } ctx->ctx.program = program; |