- if (ret)
- return ret;
- }
- break;
-
- case NODE_TYPEALIAS_TARGET:
- print_tabs(fd, depth);
- fprintf(fd, "<target>\n");
- depth++;
-
- print_tabs(fd, depth);
- fprintf(fd, "<declaration_specifier>\n");
- cds_list_for_each_entry(iter, &node->u.typealias_target.declaration_specifier, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</declaration_specifier>\n");
-
- print_tabs(fd, depth);
- fprintf(fd, "<type_declarators>\n");
- cds_list_for_each_entry(iter, &node->u.typealias_target.type_declarators, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</type_declarators>\n");
-
- depth--;
- print_tabs(fd, depth);
- fprintf(fd, "</target>\n");
- break;
- case NODE_TYPEALIAS_ALIAS:
- print_tabs(fd, depth);
- fprintf(fd, "<alias>\n");
- depth++;
-
- print_tabs(fd, depth);
- fprintf(fd, "<declaration_specifier>\n");
- cds_list_for_each_entry(iter, &node->u.typealias_alias.declaration_specifier, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</declaration_specifier>\n");
-
- print_tabs(fd, depth);
- fprintf(fd, "<type_declarators>\n");
- cds_list_for_each_entry(iter, &node->u.typealias_alias.type_declarators, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</type_declarators>\n");
-
- depth--;
- print_tabs(fd, depth);
- fprintf(fd, "</alias>\n");
- break;
- case NODE_TYPEALIAS:
- print_tabs(fd, depth);
- fprintf(fd, "<typealias>\n");
- ret = ctf_visitor_print_xml(fd, depth + 1, node->u.typealias.target);
- if (ret)
- return ret;
- ret = ctf_visitor_print_xml(fd, depth + 1, node->u.typealias.alias);
- if (ret)
- return ret;
- print_tabs(fd, depth);
- fprintf(fd, "</typealias>\n");
- break;
-
- case NODE_TYPE_SPECIFIER:
- ret = ctf_visitor_print_type_specifier(fd, depth, node);
- if (ret)
- return ret;
- break;
- case NODE_POINTER:
- print_tabs(fd, depth);
- if (node->u.pointer.const_qualifier)
- fprintf(fd, "<const_pointer />\n");
- else
- fprintf(fd, "<pointer />\n");
- break;
- case NODE_TYPE_DECLARATOR:
- ret = ctf_visitor_print_type_declarator(fd, depth, node);
- if (ret)
- return ret;
- break;
-
- case NODE_FLOATING_POINT:
- print_tabs(fd, depth);
- fprintf(fd, "<floating_point>\n");
- cds_list_for_each_entry(iter, &node->u.floating_point.expressions, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</floating_point>\n");
- break;
- case NODE_INTEGER:
- print_tabs(fd, depth);
- fprintf(fd, "<integer>\n");
- cds_list_for_each_entry(iter, &node->u.integer.expressions, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</integer>\n");
- break;
- case NODE_STRING:
- print_tabs(fd, depth);
- fprintf(fd, "<string>\n");
- cds_list_for_each_entry(iter, &node->u.string.expressions, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</string>\n");
- break;
- case NODE_ENUMERATOR:
- print_tabs(fd, depth);
- fprintf(fd, "<enumerator");
- if (node->u.enumerator.id)
- fprintf(fd, " id=\"%s\"", node->u.enumerator.id);
- fprintf(fd, ">\n");
- cds_list_for_each_entry(iter, &node->u.enumerator.values, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</enumerator>\n");
- break;
- case NODE_ENUM:
- print_tabs(fd, depth);
- if (node->u._struct.name)
- fprintf(fd, "<enum name=\"%s\">\n",
- node->u._enum.enum_id);
- else
- fprintf(fd, "<enum >\n");
- depth++;
-
- if (node->u._enum.container_type) {
- print_tabs(fd, depth);
- fprintf(fd, "<container_type>\n");
- ret = ctf_visitor_print_xml(fd, depth + 1, node->u._enum.container_type);
- if (ret)
- return ret;
- print_tabs(fd, depth);
- fprintf(fd, "</container_type>\n");
- }
-
- print_tabs(fd, depth);
- fprintf(fd, "<enumerator_list>\n");
- cds_list_for_each_entry(iter, &node->u._enum.enumerator_list, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</enumerator_list>\n");
-
- depth--;
- print_tabs(fd, depth);
- fprintf(fd, "</enum>\n");
- break;
- case NODE_STRUCT_OR_VARIANT_DECLARATION:
- print_tabs(fd, depth);
- fprintf(fd, "<declaration_specifier>\n");
- cds_list_for_each_entry(iter, &node->u.struct_or_variant_declaration.declaration_specifier, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</declaration_specifier>\n");
-
- print_tabs(fd, depth);
- fprintf(fd, "<type_declarators>\n");
- cds_list_for_each_entry(iter, &node->u.struct_or_variant_declaration.type_declarators, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</type_declarators>\n");
- break;
- case NODE_VARIANT:
- print_tabs(fd, depth);
- fprintf(fd, "<variant");
- if (node->u.variant.name)
- fprintf(fd, " name=\"%s\"", node->u.variant.name);
- if (node->u.variant.choice)
- fprintf(fd, " choice=\"%s\"", node->u.variant.choice);
- fprintf(fd, ">\n");
- cds_list_for_each_entry(iter, &node->u.variant.declaration_list, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;
- }
- print_tabs(fd, depth);
- fprintf(fd, "</variant>\n");
- break;
- case NODE_STRUCT:
- print_tabs(fd, depth);
- if (node->u._struct.name)
- fprintf(fd, "<struct name=\"%s\">\n",
- node->u._struct.name);
- else
- fprintf(fd, "<struct>\n");
- cds_list_for_each_entry(iter, &node->u._struct.declaration_list, siblings) {
- ret = ctf_visitor_print_xml(fd, depth + 1, iter);
- if (ret)
- return ret;