append(format("Assignment: %s%s", assign.oper, (assign.self_referencing ? " (self-referencing)" : "")));
begin_sub();
if(assign.target_declaration)
- {
append(format("Target: %%%d %s %s", get_label(*assign.target_declaration), assign.target_declaration->type, assign.target_declaration->name));
- }
assign.left->visit(*this);
last_branch();
assign.right->visit(*this);
void DumpTree::visit(FunctionDeclaration &func)
{
- append(format("%%%d %s %s()", get_label(func), func.return_type, func.name));
+ string text = format("%%%d %s %s", get_label(func), func.return_type, func.name);
+ if(!func.definition)
+ text += " (undefined)";
+ append(text);
begin_sub();
for(NodeArray<VariableDeclaration>::const_iterator i=func.parameters.begin(); i!=func.parameters.end(); ++i)
(*i)->visit(*this);
- if(func.definition)
- append(format("Definition: %%%d", get_label(*func.definition)));
last_branch();
- func.body.visit(*this);
+ if(func.definition!=&func)
+ append(format("Definition: %%%d", get_label(*func.definition)));
+ else
+ func.body.visit(*this);
end_sub();
}