}
-BinaryExpression::BinaryExpression():
- assignment(false)
+void BinaryExpression::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+Assignment::Assignment():
+ self_referencing(false),
+ target_declaration(0)
{ }
-void BinaryExpression::visit(NodeVisitor &visitor)
+void Assignment::visit(NodeVisitor &visitor)
{
visitor.visit(*this);
}
FunctionCall::FunctionCall():
+ declaration(0),
constructor(false)
{ }
}
+void Import::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
void Layout::visit(NodeVisitor &visitor)
{
visitor.visit(*this);
}
+void InterfaceLayout::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
StructDeclaration::StructDeclaration()
{
members.use_braces = true;
}
-InterfaceBlock::InterfaceBlock()
+InterfaceBlock::InterfaceBlock():
+ array(false)
{
members.use_braces = true;
}
FunctionDeclaration::FunctionDeclaration():
- definition(false)
+ definition(0)
+{ }
+
+FunctionDeclaration::FunctionDeclaration(const FunctionDeclaration &other):
+ return_type(other.return_type),
+ name(other.name),
+ parameters(other.parameters),
+ definition(other.definition==&other ? this : other.definition),
+ body(other.body)
{ }
void FunctionDeclaration::visit(NodeVisitor &visitor)
}
+void NodeVisitor::visit(Assignment &assign)
+{
+ visit(static_cast<BinaryExpression &>(assign));
+}
+
+
void TraversingVisitor::visit(Block &block)
{
for(list<NodePtr<Node> >::iterator i=block.body.begin(); i!=block.body.end(); ++i)
expr.expression->visit(*this);
}
+void TraversingVisitor::visit(InterfaceLayout &layout)
+{
+ layout.layout.visit(*this);
+}
+
void TraversingVisitor::visit(StructDeclaration &strct)
{
strct.members.visit(*this);
void TraversingVisitor::visit(VariableDeclaration &var)
{
+ if(var.layout)
+ var.layout->visit(*this);
if(var.init_expression)
var.init_expression->visit(*this);
if(var.array_size)