rewrite to union type, much better
[ccc.git] / expr.c
diff --git a/expr.c b/expr.c
index b5c8228..725e397 100644 (file)
--- a/expr.c
+++ b/expr.c
@@ -7,12 +7,17 @@ extern int yylex_destroy(void);
 
 int main()
 {
-       struct ast *result = NULL;
+       fprintf(stderr, "sizeof(struct ast): %lu\n", sizeof(struct ast));
+       fprintf(stderr, "sizeof(struct vardecl): %lu\n", sizeof(struct vardecl));
+       fprintf(stderr, "sizeof(struct decl): %lu\n", sizeof(struct decl));
+       fprintf(stderr, "sizeof(struct stmt): %lu\n", sizeof(struct stmt));
+       fprintf(stderr, "sizeof(struct expr): %lu\n", sizeof(struct expr));
+       struct ast *result;
         int r = yyparse(&result);
        if (r != 0)
                return r;
        yylex_destroy();
-       ast_print(result, 0, stdout);
+       ast_print(result, stdout);
        ast_free(result);
        return 0;
 }