X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=wrappergen%2Fwrite_fluffy.c;h=05763d44dc80ad815b9f45c9492e6970d12d4080;hb=d85a04555ea643285364ee0f922d0260f26f2599;hp=ac5456a0b9bab8ee314bdbe991b822562497b5e8;hpb=6d7d61de445629e1590d3a2ba2990ef7a651368a;p=cparser diff --git a/wrappergen/write_fluffy.c b/wrappergen/write_fluffy.c index ac5456a..05763d4 100644 --- a/wrappergen/write_fluffy.c +++ b/wrappergen/write_fluffy.c @@ -29,6 +29,7 @@ #include "entity_t.h" #include "type.h" #include "adt/error.h" +#include "printer.h" static const scope_t *global_scope; static FILE *out; @@ -222,16 +223,9 @@ static void write_unary_expression(const unary_expression_t *expression) static void write_expression(const expression_t *expression) { - const const_expression_t *constant; - /* TODO */ switch(expression->kind) { - case EXPR_CONST: - constant = &expression->conste; - if(is_type_integer(expression->base.type)) { - fprintf(out, "%lld", constant->v.int_value); - } else { - fprintf(out, "%Lf", constant->v.float_value); - } + case EXPR_LITERAL_INTEGER: + fprintf(out, "%s", expression->literal.value.begin); break; EXPR_UNARY_CASES write_unary_expression((const unary_expression_t*) expression); @@ -317,8 +311,7 @@ void write_fluffy_decls(FILE *output, const translation_unit_t *unit) out = output; global_scope = &unit->scope; - ast_set_output(out); - type_set_output(out); + print_to_file(out); fprintf(out, "/* WARNING: Automatically generated file */\n"); /* write structs,unions + enums */