void print_expression(const expression_t *expression)
{
switch(expression->type) {
+ case EXPR_UNKNOWN:
case EXPR_INVALID:
fprintf(out, "*invalid expression*");
break;
static void print_goto_statement(const goto_statement_t *statement)
{
fprintf(out, "goto ");
- if(statement->label != NULL) {
- fprintf(out, "%s", statement->label->symbol->string);
- } else {
- fprintf(out, "?%s", statement->label_symbol->string);
- }
+ fputs(statement->label->symbol->string, out);
+ fprintf(stderr, "(%p)", (void*) statement->label);
fputs(";\n", out);
}
static void print_label_statement(const label_statement_t *statement)
{
- fprintf(out, "%s:\n", statement->symbol->string);
+ fprintf(stderr, "(%p)", (void*) statement->label);
+ fprintf(out, "%s:\n", statement->label->symbol->string);
+ if(statement->label_statement != NULL) {
+ print_statement(statement->label_statement);
+ }
}
static void print_if_statement(const if_statement_t *statement)
static void print_normal_declaration(const declaration_t *declaration)
{
- print_storage_class(declaration->storage_class);
+ print_storage_class((storage_class_t)declaration->storage_class);
print_type_ext(declaration->type, declaration->symbol,
&declaration->context);
+ if(declaration->is_inline) {
+ fputs("inline ", out);
+ }
+
if(declaration->type->type == TYPE_FUNCTION) {
if(declaration->init.statement != NULL) {
fputs("\n", out);