]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programsyntax.h
Add functions for setting arrays of 2x2 and 3x3 matrix uniforms
[libs/gl.git] / source / programsyntax.h
index 6a03f40fab67b2f4b02d17de5873587edf1d3e88..590429519118614f6a59a83796da97f50693ff9c 100644 (file)
@@ -64,9 +64,19 @@ struct StructDeclaration;
 struct VariableDeclaration;
 struct FunctionDeclaration;
 
+struct Statement: Node
+{
+       unsigned source;
+       unsigned line;
+
+       Statement();
+
+       virtual Statement *clone() const = 0;
+};
+
 struct Block: Node
 {
-       NodeList<Node> body;
+       NodeList<Statement> body;
        bool use_braces;
        std::map<std::string, StructDeclaration *> types;
        std::map<std::string, VariableDeclaration *> variables;
@@ -166,7 +176,7 @@ struct FunctionCall: Expression
        virtual void visit(NodeVisitor &);
 };
 
-struct ExpressionStatement: Node
+struct ExpressionStatement: Statement
 {
        NodePtr<Expression> expression;
 
@@ -174,7 +184,7 @@ struct ExpressionStatement: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct Import: Node
+struct Import: Statement
 {
        std::string module;
 
@@ -182,7 +192,7 @@ struct Import: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct Precision: Node
+struct Precision: Statement
 {
        std::string precision;
        std::string type;
@@ -206,7 +216,7 @@ struct Layout: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct InterfaceLayout: Node
+struct InterfaceLayout: Statement
 {
        std::string interface;
        Layout layout;
@@ -215,7 +225,7 @@ struct InterfaceLayout: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct StructDeclaration: Node
+struct StructDeclaration: Statement
 {
        std::string name;
        Block members;
@@ -226,7 +236,7 @@ struct StructDeclaration: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct VariableDeclaration: Node
+struct VariableDeclaration: Statement
 {
        bool constant;
        std::string sampling;
@@ -248,7 +258,7 @@ struct VariableDeclaration: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct InterfaceBlock: Node
+struct InterfaceBlock: Statement
 {
        std::string interface;
        std::string name;
@@ -262,7 +272,7 @@ struct InterfaceBlock: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct FunctionDeclaration: Node
+struct FunctionDeclaration: Statement
 {
        std::string return_type;
        std::string name;
@@ -277,7 +287,7 @@ struct FunctionDeclaration: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct Conditional: Node
+struct Conditional: Statement
 {
        NodePtr<Expression> condition;
        Block body;
@@ -287,7 +297,7 @@ struct Conditional: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct Iteration: Node
+struct Iteration: Statement
 {
        NodePtr<Node> init_statement;
        NodePtr<Expression> condition;
@@ -298,7 +308,7 @@ struct Iteration: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct Passthrough: Node
+struct Passthrough: Statement
 {
        NodePtr<Expression> subscript;
 
@@ -306,7 +316,7 @@ struct Passthrough: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct Return: Node
+struct Return: Statement
 {
        NodePtr<Expression> expression;
 
@@ -314,7 +324,7 @@ struct Return: Node
        virtual void visit(NodeVisitor &);
 };
 
-struct Jump: Node
+struct Jump: Statement
 {
        std::string keyword;
 
@@ -389,6 +399,7 @@ struct Stage
        std::map<std::string, VariableDeclaration *> out_variables;
        std::map<std::string, unsigned> locations;
        Version required_version;
+       std::vector<const Extension *> required_extensions;
 
        Stage(StageType);
 };