- append(format("Literal: %s -> %s", literal.token, format_type(literal.type)));
+ append(literal, format("Literal: %s -> %s", literal.token, format_type(literal.type)));
if(var.declaration)
text += format("%%%d ", get_label(*var.declaration));
text += format("%s (var) -> %s", var.name, format_type(var.type));
if(var.declaration)
text += format("%%%d ", get_label(*var.declaration));
text += format("%s (var) -> %s", var.name, format_type(var.type));
if(iface.declaration)
text += format("%%%d ", get_label(*iface.declaration));
text += format("%s (iface) -> %s", iface.name, format_type(iface.type));
if(iface.declaration)
text += format("%%%d ", get_label(*iface.declaration));
text += format("%s (iface) -> %s", iface.name, format_type(iface.type));
if(memacc.declaration)
text += format(" %%%d", get_label(*memacc.declaration));
text += format(" .%s -> %s", memacc.member, format_type(memacc.type));
if(memacc.declaration)
text += format(" %%%d", get_label(*memacc.declaration));
text += format(" .%s -> %s", memacc.member, format_type(memacc.type));
for(unsigned i=0; i<swizzle.count; ++i)
text += components[swizzle.components[i]];
text += format(" -> %s", format_type(swizzle.type));
for(unsigned i=0; i<swizzle.count; ++i)
text += components[swizzle.components[i]];
text += format(" -> %s", format_type(swizzle.type));
}
void DumpTree::visit(UnaryExpression &unary)
{
string text = format("Unary: %s, %sfix -> %s", unary.oper->token, (unary.oper->type==Operator::PREFIX ? "pre" : "post"), format_type(unary.type));
}
void DumpTree::visit(UnaryExpression &unary)
{
string text = format("Unary: %s, %sfix -> %s", unary.oper->token, (unary.oper->type==Operator::PREFIX ? "pre" : "post"), format_type(unary.type));
- append(format("Binary: %s%s -> %s", binary.oper->token, binary.oper->token2, format_type(binary.type)));
+ append(binary, format("Binary: %s%s -> %s", binary.oper->token, binary.oper->token2, format_type(binary.type)));
- append(format("Assignment: %s%s -> %s", assign.oper->token, (assign.self_referencing ? " (self-referencing)" : ""), format_type(assign.type)));
+ append(assign, format("Assignment: %s%s -> %s", assign.oper->token, (assign.self_referencing ? " (self-referencing)" : ""), format_type(assign.type)));
- append(format("Ternary: %s%s -> %s", ternary.oper->token, ternary.oper->token2, format_type(ternary.type)));
+ append(ternary, format("Ternary: %s%s -> %s", ternary.oper->token, ternary.oper->token2, format_type(ternary.type)));
if(call.constructor)
head += " (constructor)";
head += format(" -> %s", format_type(call.type));
if(call.constructor)
head += " (constructor)";
head += format(" -> %s", format_type(call.type));
- append(format("precision %s %s", prec.precision, prec.type));
+ append(prec, format("precision %s %s", prec.precision, prec.type));
- annotated_branch(format("Layout: %s", layout.interface), layout.layout);
+ append(layout, format("Layout: %s", layout.interface));
+ append_subtree(layout.layout);
- append(format("%%%d typedef %s", get_label(type), type.name));
+ append(type, format("%%%d typedef %s", get_label(type), type.name));
{
static const char *dims[] = { "1D", "2D", "3D", "Cube" };
{
static const char *dims[] = { "1D", "2D", "3D", "Cube" };
- append(format("%%%d typedef %s", get_label(type), type.name));
+ 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" : "")));
vector<Branch> branches;
branches.push_back(format("Dimensions: %s%s", dims[type.dimensions-1], (type.array ? " array" : "")));
- annotated_branch(format("%%%d struct %s", get_label(strct), strct.name), strct.members);
+ append(strct, format("%%%d struct %s", get_label(strct), strct.name));
+ append_subtree(strct.members);
if(iface.type_declaration)
append(format("Type: %%%d %s", get_label(*iface.type_declaration), iface.type_declaration->name));
if(iface.type_declaration)
append(format("Type: %%%d %s", get_label(*iface.type_declaration), iface.type_declaration->name));
- else if(iface.members)
- iface.members->visit(*this);
- end_sub();
+ if(iface.layout)
+ branches.push_back(Branch("Layout", iface.layout.get()));
+ if(iface.members)
+ branches.push_back(Branch("Members", iface.members.get()));
+ append_subtree(branches);