Move the ExprResult struct from the Parser to the Actions.

llvm-svn: 38946
This commit is contained in:
Chris Lattner 2006-08-24 04:56:36 +00:00
parent 0eedafed1d
commit e1598f0184
2 changed files with 17 additions and 12 deletions

View File

@ -49,6 +49,22 @@ public:
typedef void ExprTy;
typedef void DeclTy;
/// ExprResult - This structure is used while parsing/acting on expressions.
/// It encapsulates both the expression object returned by the action, plus
/// a sense of whether or not it is valid.
struct ExprResult {
ExprTy *Val;
bool isInvalid;
ExprResult(bool Invalid = false) : Val(0), isInvalid(Invalid) {}
const ExprResult &operator=(ExprTy *RHS) {
Val = RHS;
isInvalid = false;
return *this;
}
};
//===--------------------------------------------------------------------===//
// Symbol Table Tracking Callbacks.
//===--------------------------------------------------------------------===//

View File

@ -220,18 +220,7 @@ private:
//===--------------------------------------------------------------------===//
// C99 6.5: Expressions.
struct ExprResult {
ExprTy *Val;
bool isInvalid;
ExprResult(bool Invalid = false) : Val(0), isInvalid(Invalid) {}
const ExprResult &operator=(ExprTy *RHS) {
Val = RHS;
isInvalid = false;
return *this;
}
};
typedef Action::ExprResult ExprResult;
ExprResult ParseExpression();
ExprResult ParseConstantExpression();