+ append(layout, format("Layout: %s", layout.interface));
+ append_subtree(layout.layout);
+}
+
+void DumpTree::visit(BasicTypeDeclaration &type)
+{
+ append(type, format("%%%d typedef %s", get_label(type), type.name));
+
+ vector<Branch> branches;
+ if(type.base_type)
+ branches.push_back(format("%s: %%%d %s", (type.kind==BasicTypeDeclaration::ALIAS ? "Alias of" : "Base"), get_label(*type.base_type), type.base_type->name));
+ if(type.kind==BasicTypeDeclaration::VECTOR)
+ branches.push_back(format("Vector: %d", type.size));
+ else if(type.kind==BasicTypeDeclaration::MATRIX)
+ branches.push_back(format("Matrix: %dx%d", type.size&0xFFFF, type.size>>16));
+ append_subtree(branches);
+}
+
+void DumpTree::visit(ImageTypeDeclaration &type)
+{
+ static const char *dims[] = { "1D", "2D", "3D", "Cube" };
+
+ append(type, format("%%%d typedef %s", get_label(type), type.name));
+
+ vector<Branch> branches;
+ branches.push_back(format("Dimensions: %s%s", dims[type.dimensions-1], (type.array ? " array" : "")));
+ if(type.base_type)
+ branches.push_back(format("Element type: %%%d %s", get_label(*type.base_type), type.base_type->name));
+ if(type.shadow)
+ branches.push_back("Shadow");
+ append_subtree(branches);