summaryrefslogtreecommitdiff
path: root/src/libs/glsl/glslsemantic.h
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-11-26 12:08:43 +0100
committerRoberto Raggi <roberto.raggi@nokia.com>2010-11-26 12:08:43 +0100
commitded9ed66ef642b4feae4bbeffdc6003e6ede9bc7 (patch)
treeb5c23edcca8665608a1789aff3fbfc477e99f09d /src/libs/glsl/glslsemantic.h
parent57e881600177a9c23f9c47ec1de3649050ed8315 (diff)
downloadqt-creator-ded9ed66ef642b4feae4bbeffdc6003e6ede9bc7.tar.gz
Evaluate the expression's attributes.
Diffstat (limited to 'src/libs/glsl/glslsemantic.h')
-rw-r--r--src/libs/glsl/glslsemantic.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libs/glsl/glslsemantic.h b/src/libs/glsl/glslsemantic.h
index ce65381634..9dcbeed869 100644
--- a/src/libs/glsl/glslsemantic.h
+++ b/src/libs/glsl/glslsemantic.h
@@ -39,7 +39,18 @@ public:
Semantic(Engine *engine);
virtual ~Semantic();
- void expression(ExpressionAST *ast);
+ struct ExprResult {
+ ExprResult(const Type *type = 0, bool isConstant = false)
+ : type(type), isConstant(isConstant) {}
+
+ bool isValid() const { return type != 0; }
+ operator bool() const { return type != 0; }
+
+ const Type *type;
+ bool isConstant;
+ };
+
+ ExprResult expression(ExpressionAST *ast);
void statement(StatementAST *ast);
const Type *type(TypeAST *ast);
void declaration(DeclarationAST *ast);
@@ -98,8 +109,9 @@ protected:
private:
Engine *_engine;
- const Type *_type;
Scope *_scope;
+ const Type *_type;
+ ExprResult _expr;
};
} // namespace GLSL