head += " (linked)";
append(head);
- begin_sub();
- last_branch();
+ vector<Branch> branches;
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);
}
void DumpTree::visit(FunctionDeclaration &func)
void Formatter::visit(InterfaceBlock &iface)
{
+ if(iface.layout)
+ {
+ iface.layout->visit(*this);
+ append(' ');
+ }
append(format("%s %s\n", iface.interface, iface.block_name));
if(iface.struct_declaration)
iface.struct_declaration->members.visit(*this);
tokenizer.expect(";");
return iface_lo;
}
+ else if(is_interface_qualifier(token) && tokenizer.peek_token(2)=="{")
+ {
+ RefPtr<InterfaceBlock> iface = parse_interface_block();
+ iface->layout = layout;
+ return iface;
+ }
else
{
RefPtr<VariableDeclaration> var = parse_variable_declaration();
struct InterfaceBlock: Statement
{
+ NodePtr<Layout> layout;
std::string interface;
std::string block_name;
NodePtr<Block> members;
void TraversingVisitor::visit(InterfaceBlock &iface)
{
+ if(iface.layout)
+ iface.layout->visit(*this);
if(iface.members)
iface.members->visit(*this);
}