X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fsyntax.h;h=55f47402f514538b959a459a07b3532e2a0d5efd;hb=7f29c6d2a4eee36538d7ccf24980e749592e2444;hp=f7e778b89ef65d417afd1f44751930311c5e94ed;hpb=bd8816692056230c36504dcccd76c6946dff47b1;p=libs%2Fgl.git diff --git a/source/glsl/syntax.h b/source/glsl/syntax.h index f7e778b8..55f47402 100644 --- a/source/glsl/syntax.h +++ b/source/glsl/syntax.h @@ -108,9 +108,8 @@ struct Block: Node { NodeList body; bool use_braces; - std::map types; + std::map variables; - std::map interfaces; Block *parent; Block(); @@ -144,6 +143,7 @@ struct ParenthesizedExpression: Expression struct VariableReference: Expression { std::string name; + VariableDeclaration *declaration; VariableReference(); @@ -156,6 +156,7 @@ struct VariableReference: Expression struct InterfaceBlockReference: Expression { std::string name; + InterfaceBlock *declaration; InterfaceBlockReference(); @@ -169,6 +170,7 @@ struct MemberAccess: Expression { NodePtr left; std::string member; + VariableDeclaration *declaration; MemberAccess(); @@ -204,6 +206,7 @@ struct BinaryExpression: Expression struct Assignment: BinaryExpression { bool self_referencing; + VariableDeclaration *target_declaration; Assignment(); @@ -216,10 +219,11 @@ struct Assignment: BinaryExpression struct FunctionCall: Expression { std::string name; - FunctionDeclaration *declaration; bool constructor; NodeArray arguments; + FunctionDeclaration *declaration; + FunctionCall(); FunctionCall(const FunctionCall &); @@ -289,22 +293,24 @@ struct StructDeclaration: Statement struct VariableDeclaration: Statement { + NodePtr layout; bool constant; std::string sampling; std::string interpolation; std::string interface; std::string precision; std::string type; - StructDeclaration *type_declaration; std::string name; bool array; NodePtr array_size; NodePtr init_expression; + + StructDeclaration *type_declaration; VariableDeclaration *linked_declaration; - NodePtr layout; VariableDeclaration(); VariableDeclaration(const VariableDeclaration &); + ~VariableDeclaration(); virtual VariableDeclaration *clone() const { return new VariableDeclaration(*this); } virtual void visit(NodeVisitor &); @@ -317,10 +323,12 @@ struct InterfaceBlock: Statement Block members; std::string instance_name; bool array; + InterfaceBlock *linked_block; InterfaceBlock(); InterfaceBlock(const InterfaceBlock &); + ~InterfaceBlock(); virtual InterfaceBlock *clone() const { return new InterfaceBlock(*this); } virtual void visit(NodeVisitor &); @@ -331,9 +339,10 @@ struct FunctionDeclaration: Statement std::string return_type; std::string name; NodeArray parameters; - FunctionDeclaration *definition; Block body; + FunctionDeclaration *definition; + FunctionDeclaration(); FunctionDeclaration(const FunctionDeclaration &); @@ -399,6 +408,8 @@ struct Stage Type type; Stage *previous; Block content; + std::map types; + std::map interface_blocks; std::map locations; Features required_features;