forked from OSchip/llvm-project
Move the ExprResult struct from the Parser to the Actions.
llvm-svn: 38946
This commit is contained in:
parent
0eedafed1d
commit
e1598f0184
|
@ -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.
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue