--- /dev/null
+#include "programsyntax.h"
+
+using namespace std;
+
+namespace Msp {
+namespace GL {
+namespace ProgramSyntax {
+
+template<typename C>
+NodeContainer<C>::NodeContainer(const NodeContainer &c):
+ C(c)
+{
+ for(typename C::iterator i=this->begin(); i!=this->end(); ++i)
+ *i = (*i)->clone();
+}
+
+
+Statement::Statement():
+ source(0),
+ line(1)
+{ }
+
+
+Block::Block():
+ use_braces(false)
+{ }
+
+void Block::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void Literal::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void ParenthesizedExpression::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+VariableReference::VariableReference():
+ declaration(0)
+{ }
+
+void VariableReference::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void MemberAccess::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+UnaryExpression::UnaryExpression():
+ prefix(true)
+{ }
+
+void UnaryExpression::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void BinaryExpression::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+Assignment::Assignment():
+ self_referencing(false),
+ target_declaration(0)
+{ }
+
+void Assignment::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+FunctionCall::FunctionCall():
+ declaration(0),
+ constructor(false)
+{ }
+
+void FunctionCall::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void ExpressionStatement::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void Import::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void Precision::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;
+}
+
+void StructDeclaration::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+VariableDeclaration::VariableDeclaration():
+ constant(false),
+ type_declaration(0),
+ array(false),
+ linked_declaration(0)
+{ }
+
+void VariableDeclaration::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+InterfaceBlock::InterfaceBlock():
+ array(false)
+{
+ members.use_braces = true;
+}
+
+void InterfaceBlock::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+FunctionDeclaration::FunctionDeclaration():
+ 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)
+{
+ visitor.visit(*this);
+}
+
+
+void Conditional::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void Iteration::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void Passthrough::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void Return::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void Jump::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+void NodeVisitor::visit(Assignment &assign)
+{
+ visit(static_cast<BinaryExpression &>(assign));
+}
+
+
+void TraversingVisitor::visit(Block &block)
+{
+ for(NodeList<Statement>::iterator i=block.body.begin(); i!=block.body.end(); ++i)
+ (*i)->visit(*this);
+}
+
+void TraversingVisitor::visit(ParenthesizedExpression &parexpr)
+{
+ parexpr.expression->visit(*this);
+}
+
+void TraversingVisitor::visit(MemberAccess &memacc)
+{
+ memacc.left->visit(*this);
+}
+
+void TraversingVisitor::visit(UnaryExpression &unary)
+{
+ unary.expression->visit(*this);
+}
+
+void TraversingVisitor::visit(BinaryExpression &binary)
+{
+ binary.left->visit(*this);
+ binary.right->visit(*this);
+}
+
+void TraversingVisitor::visit(FunctionCall &call)
+{
+ for(NodeArray<Expression>::iterator i=call.arguments.begin(); i!=call.arguments.end(); ++i)
+ (*i)->visit(*this);
+}
+
+void TraversingVisitor::visit(ExpressionStatement &expr)
+{
+ 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)
+ var.array_size->visit(*this);
+}
+
+void TraversingVisitor::visit(InterfaceBlock &iface)
+{
+ iface.members.visit(*this);
+}
+
+void TraversingVisitor::visit(FunctionDeclaration &func)
+{
+ for(NodeArray<VariableDeclaration>::iterator i=func.parameters.begin(); i!=func.parameters.end(); ++i)
+ (*i)->visit(*this);
+ func.body.visit(*this);
+}
+
+void TraversingVisitor::visit(Conditional &cond)
+{
+ cond.condition->visit(*this);
+ cond.body.visit(*this);
+ cond.else_body.visit(*this);
+}
+
+void TraversingVisitor::visit(Iteration &iter)
+{
+ if(iter.init_statement)
+ iter.init_statement->visit(*this);
+ if(iter.condition)
+ iter.condition->visit(*this);
+ if(iter.loop_expression)
+ iter.loop_expression->visit(*this);
+ iter.body.visit(*this);
+}
+
+void TraversingVisitor::visit(Passthrough &pass)
+{
+ if(pass.subscript)
+ pass.subscript->visit(*this);
+}
+
+void TraversingVisitor::visit(Return &ret)
+{
+ if(ret.expression)
+ ret.expression->visit(*this);
+}
+
+
+Stage::Stage(StageType t):
+ type(t),
+ previous(0)
+{ }
+
+
+Module::Module():
+ shared(SHARED)
+{ }
+
+} // namespace ProgramSyntax
+} // namespace GL
+} // namespace Msp