]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.cpp
Resolve the return types of functions
[libs/gl.git] / source / glsl / syntax.cpp
index b74f482aa8df5a21dfffebc23c2f2b6fb8a8dd21..c8058c4fe9a228b102cbe4792daa83dc3f921f70 100644 (file)
@@ -75,12 +75,6 @@ NodeContainer<C>::NodeContainer(const NodeContainer &c):
 }
 
 
-Statement::Statement():
-       source(GENERATED_SOURCE),
-       line(1)
-{ }
-
-
 Block::Block():
        use_braces(false),
        parent(0)
@@ -243,6 +237,39 @@ void InterfaceLayout::visit(NodeVisitor &visitor)
 }
 
 
+BasicTypeDeclaration::BasicTypeDeclaration():
+       kind(ALIAS),
+       size(0),
+       base_type(0)
+{ }
+
+BasicTypeDeclaration::BasicTypeDeclaration(const BasicTypeDeclaration &other):
+       TypeDeclaration(other),
+       kind(other.kind),
+       size(other.size),
+       base(other.base),
+       base_type(0)
+{ }
+
+void BasicTypeDeclaration::visit(NodeVisitor &visitor)
+{
+       visitor.visit(*this);
+}
+
+
+ImageTypeDeclaration::ImageTypeDeclaration():
+       dimensions(TWO),
+       array(false),
+       sampled(true),
+       shadow(false)
+{ }
+
+void ImageTypeDeclaration::visit(NodeVisitor &visitor)
+{
+       visitor.visit(*this);
+}
+
+
 StructDeclaration::StructDeclaration()
 {
        members.use_braces = true;
@@ -320,7 +347,8 @@ void InterfaceBlock::visit(NodeVisitor &visitor)
 
 
 FunctionDeclaration::FunctionDeclaration():
-       definition(0)
+       definition(0),
+       return_type_declaration(0)
 { }
 
 FunctionDeclaration::FunctionDeclaration(const FunctionDeclaration &other):
@@ -329,7 +357,8 @@ FunctionDeclaration::FunctionDeclaration(const FunctionDeclaration &other):
        name(other.name),
        parameters(other.parameters),
        body(other.body),
-       definition(other.definition==&other ? this : 0)
+       definition(other.definition==&other ? this : 0),
+       return_type_declaration(0)
 { }
 
 void FunctionDeclaration::visit(NodeVisitor &visitor)