Added semantic checks for compound expressions.

This commit is contained in:
Erik Verbruggen
2010-02-04 16:31:29 +01:00
parent fd90c3503d
commit 6ca5f5f5f8
8 changed files with 74 additions and 27 deletions

View File

@@ -50,9 +50,9 @@
#define CPLUSPLUS_CHECKSTATEMENT_H
#include "CPlusPlusForwardDeclarations.h"
#include "FullySpecifiedType.h"
#include "SemanticCheck.h"
namespace CPlusPlus {
class CPLUSPLUS_EXPORT CheckStatement: public SemanticCheck
@@ -61,9 +61,10 @@ public:
CheckStatement(Semantic *semantic);
virtual ~CheckStatement();
void check(StatementAST *statement, Scope *scope);
FullySpecifiedType check(StatementAST *statement, Scope *scope);
protected:
FullySpecifiedType switchExprType(const FullySpecifiedType &type);
StatementAST *switchStatement(StatementAST *statement);
Scope *switchScope(Scope *scope);
@@ -98,9 +99,12 @@ protected:
ExpressionAST *expression,
StatementAST *statement,
Block *&symbol);
FullySpecifiedType checkCompoundStmt(CompoundStatementAST *stmt);
private:
StatementAST *_statement;
Scope *_scope;
FullySpecifiedType _exprType;
};
} // end of namespace CPlusPlus