Block::Block():
- use_braces(false)
+ use_braces(false),
+ parent(0)
+{ }
+
+Block::Block(const Block &other):
+ Node(other),
+ body(other.body),
+ use_braces(other.use_braces),
+ parent(0)
{ }
void Block::visit(NodeVisitor &visitor)
declaration(0)
{ }
+VariableReference::VariableReference(const VariableReference &other):
+ name(other.name),
+ declaration(0)
+{ }
+
void VariableReference::visit(NodeVisitor &visitor)
{
visitor.visit(*this);
}
+InterfaceBlockReference::InterfaceBlockReference():
+ declaration(0)
+{ }
+
+InterfaceBlockReference::InterfaceBlockReference(const InterfaceBlockReference &other):
+ name(other.name),
+ declaration(0)
+{ }
+
+void InterfaceBlockReference::visit(NodeVisitor &visitor)
+{
+ visitor.visit(*this);
+}
+
+
+MemberAccess::MemberAccess():
+ declaration(0)
+{ }
+
+MemberAccess::MemberAccess(const MemberAccess &other):
+ left(other.left),
+ member(other.member),
+ declaration(0)
+{ }
+
void MemberAccess::visit(NodeVisitor &visitor)
{
visitor.visit(*this);
target_declaration(0)
{ }
+Assignment::Assignment(const Assignment &other):
+ self_referencing(other.self_referencing),
+ target_declaration(0)
+{ }
+
void Assignment::visit(NodeVisitor &visitor)
{
visitor.visit(*this);
FunctionCall::FunctionCall():
- declaration(0),
- constructor(false)
+ constructor(false),
+ declaration(0)
+{ }
+
+FunctionCall::FunctionCall(const FunctionCall &other):
+ name(other.name),
+ constructor(other.constructor),
+ arguments(other.arguments),
+ declaration(0)
{ }
void FunctionCall::visit(NodeVisitor &visitor)
VariableDeclaration::VariableDeclaration():
constant(false),
- type_declaration(0),
array(false),
+ type_declaration(0),
+ linked_declaration(0)
+{ }
+
+VariableDeclaration::VariableDeclaration(const VariableDeclaration &other):
+ layout(other.layout),
+ constant(other.constant),
+ sampling(other.sampling),
+ interpolation(other.interpolation),
+ interface(other.interface),
+ precision(other.precision),
+ type(other.type),
+ name(other.name),
+ array(other.array),
+ array_size(other.array_size),
+ init_expression(other.init_expression),
+ type_declaration(0),
linked_declaration(0)
{ }
+VariableDeclaration::~VariableDeclaration()
+{
+ if(linked_declaration && linked_declaration->linked_declaration==this)
+ linked_declaration->linked_declaration = 0;
+}
+
void VariableDeclaration::visit(NodeVisitor &visitor)
{
visitor.visit(*this);
InterfaceBlock::InterfaceBlock():
- array(false)
+ array(false),
+ linked_block(0)
{
members.use_braces = true;
}
+InterfaceBlock::InterfaceBlock(const InterfaceBlock &other):
+ interface(other.interface),
+ name(other.name),
+ members(other.members),
+ instance_name(other.instance_name),
+ array(other.array),
+ linked_block(0)
+{ }
+
+InterfaceBlock::~InterfaceBlock()
+{
+ if(linked_block && linked_block->linked_block==this)
+ linked_block->linked_block = 0;
+}
+
void InterfaceBlock::visit(NodeVisitor &visitor)
{
visitor.visit(*this);
return_type(other.return_type),
name(other.name),
parameters(other.parameters),
- definition(other.definition==&other ? this : other.definition),
- body(other.body)
+ body(other.body),
+ definition(other.definition==&other ? this : 0)
{ }
void FunctionDeclaration::visit(NodeVisitor &visitor)
previous(0)
{ }
+const char *Stage::get_stage_name(Type type)
+{
+ static const char *names[] = { "shared", "vertex", "geometry", "fragment" };
+ return names[type];
+}
+
Module::Module():
shared(Stage::SHARED)