Evaluate the expression's attributes.

This commit is contained in:
Roberto Raggi
2010-11-26 12:08:43 +01:00
parent 57e8816001
commit ded9ed66ef
2 changed files with 43 additions and 28 deletions

View File

@@ -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