]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.h
Add support for function overloading
[libs/gl.git] / source / glsl / syntax.h
index c3eeb6a14c7c244cea696bab9508f0d0bdc50012..39bc8264e1b8d30ead80ad19ad78f9232a6cd3ae 100644 (file)
@@ -230,9 +230,27 @@ struct BinaryExpression: Expression
 
 struct Assignment: BinaryExpression
 {
+       struct Target
+       {
+               enum ChainType
+               {
+                       MEMBER = 0x40,
+                       SWIZZLE = 0x80,
+                       ARRAY = 0xC0
+               };
+
+               Statement *declaration;
+               Msp::UInt8 chain_len;
+               Msp::UInt8 chain[7];
+
+               Target(Statement * = 0);
+
+               bool operator<(const Target &) const;
+       };
+
        bool self_referencing;
 
-       VariableDeclaration *target_declaration;
+       Target target;
 
        Assignment();
        Assignment(const Assignment &);
@@ -431,6 +449,7 @@ struct FunctionDeclaration: Statement
        NodeArray<VariableDeclaration> parameters;
        Block body;
 
+       std::string signature;
        FunctionDeclaration *definition;
        TypeDeclaration *return_type_declaration;