Allow expression actions to fail

llvm-svn: 38947
This commit is contained in:
Chris Lattner 2006-08-24 05:02:11 +00:00
parent e1598f0184
commit 98286a4551
3 changed files with 103 additions and 102 deletions

View File

@ -42,39 +42,39 @@ public:
// Expression Parsing Callbacks. // Expression Parsing Callbacks.
// Primary Expressions. // Primary Expressions.
virtual ExprTy *ParseSimplePrimaryExpr(const LexerToken &Tok); virtual ExprResult ParseSimplePrimaryExpr(const LexerToken &Tok);
virtual ExprTy *ParseIntegerConstant(const LexerToken &Tok); virtual ExprResult ParseIntegerConstant(const LexerToken &Tok);
virtual ExprTy *ParseFloatingConstant(const LexerToken &Tok); virtual ExprResult ParseFloatingConstant(const LexerToken &Tok);
virtual ExprTy *ParseParenExpr(SourceLocation L, SourceLocation R, virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
ExprTy *Val); ExprTy *Val);
// Binary/Unary Operators. 'Tok' is the token for the operator. // Binary/Unary Operators. 'Tok' is the token for the operator.
virtual ExprTy *ParseUnaryOp(const LexerToken &Tok, ExprTy *Input); virtual ExprResult ParseUnaryOp(const LexerToken &Tok, ExprTy *Input);
virtual ExprTy *ParsePostfixUnaryOp(const LexerToken &Tok, ExprTy *Input); virtual ExprResult ParsePostfixUnaryOp(const LexerToken &Tok, ExprTy *Input);
virtual ExprTy *ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, virtual ExprResult ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
ExprTy *Idx, SourceLocation RLoc); ExprTy *Idx, SourceLocation RLoc);
virtual ExprTy *ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, virtual ExprResult ParseMemberReferenceExpr(ExprTy *Base,SourceLocation OpLoc,
tok::TokenKind OpKind, tok::TokenKind OpKind,
SourceLocation MemberLoc, SourceLocation MemberLoc,
IdentifierInfo &Member); IdentifierInfo &Member);
/// ParseCallExpr - Handle a call to Fn with the specified array of arguments. /// ParseCallExpr - Handle a call to Fn with the specified array of arguments.
/// This provides the location of the left/right parens and a list of comma /// This provides the location of the left/right parens and a list of comma
/// locations. /// locations.
virtual ExprTy *ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc, virtual ExprResult ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
ExprTy **Args, unsigned NumArgs, ExprTy **Args, unsigned NumArgs,
SourceLocation *CommaLocs, SourceLocation *CommaLocs,
SourceLocation RParenLoc); SourceLocation RParenLoc);
virtual ExprTy *ParseBinOp(const LexerToken &Tok, ExprTy *LHS, ExprTy *RHS); virtual ExprResult ParseBinOp(const LexerToken &Tok, ExprTy *LHS,ExprTy *RHS);
/// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null /// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
/// in the case of a the GNU conditional expr extension. /// in the case of a the GNU conditional expr extension.
virtual ExprTy *ParseConditionalOp(SourceLocation QuestionLoc, virtual ExprResult ParseConditionalOp(SourceLocation QuestionLoc,
SourceLocation ColonLoc, SourceLocation ColonLoc,
ExprTy *Cond, ExprTy *LHS, ExprTy *RHS); ExprTy *Cond, ExprTy *LHS, ExprTy *RHS);
}; };
} // end anonymous namespace } // end anonymous namespace
@ -123,7 +123,7 @@ void ASTBuilder::PopScope(SourceLocation Loc, Scope *S) {
// Expression Parsing Callbacks. // Expression Parsing Callbacks.
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
ASTBuilder::ExprTy *ASTBuilder::ParseSimplePrimaryExpr(const LexerToken &Tok) { Action::ExprResult ASTBuilder::ParseSimplePrimaryExpr(const LexerToken &Tok) {
switch (Tok.getKind()) { switch (Tok.getKind()) {
default: default:
assert(0 && "Unknown simple primary expr!"); assert(0 && "Unknown simple primary expr!");
@ -142,16 +142,16 @@ ASTBuilder::ExprTy *ASTBuilder::ParseSimplePrimaryExpr(const LexerToken &Tok) {
} }
} }
ASTBuilder::ExprTy *ASTBuilder::ParseIntegerConstant(const LexerToken &Tok) { Action::ExprResult ASTBuilder::ParseIntegerConstant(const LexerToken &Tok) {
return new IntegerConstant(); return new IntegerConstant();
} }
ASTBuilder::ExprTy *ASTBuilder::ParseFloatingConstant(const LexerToken &Tok) { Action::ExprResult ASTBuilder::ParseFloatingConstant(const LexerToken &Tok) {
return new FloatingConstant(); return new FloatingConstant();
} }
ASTBuilder::ExprTy *ASTBuilder::ParseParenExpr(SourceLocation L, Action::ExprResult ASTBuilder::ParseParenExpr(SourceLocation L,
SourceLocation R, SourceLocation R,
ExprTy *Val) { ExprTy *Val) {
// FIXME: This is obviously just for testing. // FIXME: This is obviously just for testing.
((Expr*)Val)->dump(); ((Expr*)Val)->dump();
if (!FullLocInfo) return Val; if (!FullLocInfo) return Val;
@ -160,8 +160,8 @@ ASTBuilder::ExprTy *ASTBuilder::ParseParenExpr(SourceLocation L,
} }
// Unary Operators. 'Tok' is the token for the operator. // Unary Operators. 'Tok' is the token for the operator.
ASTBuilder::ExprTy *ASTBuilder::ParseUnaryOp(const LexerToken &Tok, Action::ExprResult ASTBuilder::ParseUnaryOp(const LexerToken &Tok,
ExprTy *Input) { ExprTy *Input) {
UnaryOperator::Opcode Opc; UnaryOperator::Opcode Opc;
switch (Tok.getKind()) { switch (Tok.getKind()) {
default: assert(0 && "Unknown unary op!"); default: assert(0 && "Unknown unary op!");
@ -183,8 +183,8 @@ ASTBuilder::ExprTy *ASTBuilder::ParseUnaryOp(const LexerToken &Tok,
return new UnaryOperatorLOC(Tok.getLocation(), (Expr*)Input, Opc); return new UnaryOperatorLOC(Tok.getLocation(), (Expr*)Input, Opc);
} }
ASTBuilder::ExprTy *ASTBuilder::ParsePostfixUnaryOp(const LexerToken &Tok, Action::ExprResult ASTBuilder::ParsePostfixUnaryOp(const LexerToken &Tok,
ExprTy *Input) { ExprTy *Input) {
UnaryOperator::Opcode Opc; UnaryOperator::Opcode Opc;
switch (Tok.getKind()) { switch (Tok.getKind()) {
default: assert(0 && "Unknown unary op!"); default: assert(0 && "Unknown unary op!");
@ -198,7 +198,7 @@ ASTBuilder::ExprTy *ASTBuilder::ParsePostfixUnaryOp(const LexerToken &Tok,
return new UnaryOperatorLOC(Tok.getLocation(), (Expr*)Input, Opc); return new UnaryOperatorLOC(Tok.getLocation(), (Expr*)Input, Opc);
} }
ASTBuilder::ExprTy *ASTBuilder:: Action::ExprResult ASTBuilder::
ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
ExprTy *Idx, SourceLocation RLoc) { ExprTy *Idx, SourceLocation RLoc) {
if (!FullLocInfo) if (!FullLocInfo)
@ -207,7 +207,7 @@ ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
return new ArraySubscriptExprLOC((Expr*)Base, LLoc, (Expr*)Idx, RLoc); return new ArraySubscriptExprLOC((Expr*)Base, LLoc, (Expr*)Idx, RLoc);
} }
ASTBuilder::ExprTy *ASTBuilder:: Action::ExprResult ASTBuilder::
ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc,
tok::TokenKind OpKind, SourceLocation MemberLoc, tok::TokenKind OpKind, SourceLocation MemberLoc,
IdentifierInfo &Member) { IdentifierInfo &Member) {
@ -221,7 +221,7 @@ ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc,
/// ParseCallExpr - Handle a call to Fn with the specified array of arguments. /// ParseCallExpr - Handle a call to Fn with the specified array of arguments.
/// This provides the location of the left/right parens and a list of comma /// This provides the location of the left/right parens and a list of comma
/// locations. /// locations.
ASTBuilder::ExprTy *ASTBuilder:: Action::ExprResult ASTBuilder::
ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc, ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
ExprTy **Args, unsigned NumArgs, ExprTy **Args, unsigned NumArgs,
SourceLocation *CommaLocs, SourceLocation RParenLoc) { SourceLocation *CommaLocs, SourceLocation RParenLoc) {
@ -234,8 +234,8 @@ ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
// Binary Operators. 'Tok' is the token for the operator. // Binary Operators. 'Tok' is the token for the operator.
ASTBuilder::ExprTy *ASTBuilder::ParseBinOp(const LexerToken &Tok, ExprTy *LHS, Action::ExprResult ASTBuilder::ParseBinOp(const LexerToken &Tok, ExprTy *LHS,
ExprTy *RHS) { ExprTy *RHS) {
BinaryOperator::Opcode Opc; BinaryOperator::Opcode Opc;
switch (Tok.getKind()) { switch (Tok.getKind()) {
default: assert(0 && "Unknown binop!"); default: assert(0 && "Unknown binop!");
@ -279,10 +279,10 @@ ASTBuilder::ExprTy *ASTBuilder::ParseBinOp(const LexerToken &Tok, ExprTy *LHS,
/// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null /// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
/// in the case of a the GNU conditional expr extension. /// in the case of a the GNU conditional expr extension.
ASTBuilder::ExprTy *ASTBuilder::ParseConditionalOp(SourceLocation QuestionLoc, Action::ExprResult ASTBuilder::ParseConditionalOp(SourceLocation QuestionLoc,
SourceLocation ColonLoc, SourceLocation ColonLoc,
ExprTy *Cond, ExprTy *LHS, ExprTy *Cond, ExprTy *LHS,
ExprTy *RHS) { ExprTy *RHS) {
if (!FullLocInfo) if (!FullLocInfo)
return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS); return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS);
else else

View File

@ -42,39 +42,39 @@ public:
// Expression Parsing Callbacks. // Expression Parsing Callbacks.
// Primary Expressions. // Primary Expressions.
virtual ExprTy *ParseSimplePrimaryExpr(const LexerToken &Tok); virtual ExprResult ParseSimplePrimaryExpr(const LexerToken &Tok);
virtual ExprTy *ParseIntegerConstant(const LexerToken &Tok); virtual ExprResult ParseIntegerConstant(const LexerToken &Tok);
virtual ExprTy *ParseFloatingConstant(const LexerToken &Tok); virtual ExprResult ParseFloatingConstant(const LexerToken &Tok);
virtual ExprTy *ParseParenExpr(SourceLocation L, SourceLocation R, virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
ExprTy *Val); ExprTy *Val);
// Binary/Unary Operators. 'Tok' is the token for the operator. // Binary/Unary Operators. 'Tok' is the token for the operator.
virtual ExprTy *ParseUnaryOp(const LexerToken &Tok, ExprTy *Input); virtual ExprResult ParseUnaryOp(const LexerToken &Tok, ExprTy *Input);
virtual ExprTy *ParsePostfixUnaryOp(const LexerToken &Tok, ExprTy *Input); virtual ExprResult ParsePostfixUnaryOp(const LexerToken &Tok, ExprTy *Input);
virtual ExprTy *ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, virtual ExprResult ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
ExprTy *Idx, SourceLocation RLoc); ExprTy *Idx, SourceLocation RLoc);
virtual ExprTy *ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, virtual ExprResult ParseMemberReferenceExpr(ExprTy *Base,SourceLocation OpLoc,
tok::TokenKind OpKind, tok::TokenKind OpKind,
SourceLocation MemberLoc, SourceLocation MemberLoc,
IdentifierInfo &Member); IdentifierInfo &Member);
/// ParseCallExpr - Handle a call to Fn with the specified array of arguments. /// ParseCallExpr - Handle a call to Fn with the specified array of arguments.
/// This provides the location of the left/right parens and a list of comma /// This provides the location of the left/right parens and a list of comma
/// locations. /// locations.
virtual ExprTy *ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc, virtual ExprResult ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
ExprTy **Args, unsigned NumArgs, ExprTy **Args, unsigned NumArgs,
SourceLocation *CommaLocs, SourceLocation *CommaLocs,
SourceLocation RParenLoc); SourceLocation RParenLoc);
virtual ExprTy *ParseBinOp(const LexerToken &Tok, ExprTy *LHS, ExprTy *RHS); virtual ExprResult ParseBinOp(const LexerToken &Tok, ExprTy *LHS,ExprTy *RHS);
/// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null /// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
/// in the case of a the GNU conditional expr extension. /// in the case of a the GNU conditional expr extension.
virtual ExprTy *ParseConditionalOp(SourceLocation QuestionLoc, virtual ExprResult ParseConditionalOp(SourceLocation QuestionLoc,
SourceLocation ColonLoc, SourceLocation ColonLoc,
ExprTy *Cond, ExprTy *LHS, ExprTy *RHS); ExprTy *Cond, ExprTy *LHS, ExprTy *RHS);
}; };
} // end anonymous namespace } // end anonymous namespace
@ -123,7 +123,7 @@ void ASTBuilder::PopScope(SourceLocation Loc, Scope *S) {
// Expression Parsing Callbacks. // Expression Parsing Callbacks.
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
ASTBuilder::ExprTy *ASTBuilder::ParseSimplePrimaryExpr(const LexerToken &Tok) { Action::ExprResult ASTBuilder::ParseSimplePrimaryExpr(const LexerToken &Tok) {
switch (Tok.getKind()) { switch (Tok.getKind()) {
default: default:
assert(0 && "Unknown simple primary expr!"); assert(0 && "Unknown simple primary expr!");
@ -142,16 +142,16 @@ ASTBuilder::ExprTy *ASTBuilder::ParseSimplePrimaryExpr(const LexerToken &Tok) {
} }
} }
ASTBuilder::ExprTy *ASTBuilder::ParseIntegerConstant(const LexerToken &Tok) { Action::ExprResult ASTBuilder::ParseIntegerConstant(const LexerToken &Tok) {
return new IntegerConstant(); return new IntegerConstant();
} }
ASTBuilder::ExprTy *ASTBuilder::ParseFloatingConstant(const LexerToken &Tok) { Action::ExprResult ASTBuilder::ParseFloatingConstant(const LexerToken &Tok) {
return new FloatingConstant(); return new FloatingConstant();
} }
ASTBuilder::ExprTy *ASTBuilder::ParseParenExpr(SourceLocation L, Action::ExprResult ASTBuilder::ParseParenExpr(SourceLocation L,
SourceLocation R, SourceLocation R,
ExprTy *Val) { ExprTy *Val) {
// FIXME: This is obviously just for testing. // FIXME: This is obviously just for testing.
((Expr*)Val)->dump(); ((Expr*)Val)->dump();
if (!FullLocInfo) return Val; if (!FullLocInfo) return Val;
@ -160,8 +160,8 @@ ASTBuilder::ExprTy *ASTBuilder::ParseParenExpr(SourceLocation L,
} }
// Unary Operators. 'Tok' is the token for the operator. // Unary Operators. 'Tok' is the token for the operator.
ASTBuilder::ExprTy *ASTBuilder::ParseUnaryOp(const LexerToken &Tok, Action::ExprResult ASTBuilder::ParseUnaryOp(const LexerToken &Tok,
ExprTy *Input) { ExprTy *Input) {
UnaryOperator::Opcode Opc; UnaryOperator::Opcode Opc;
switch (Tok.getKind()) { switch (Tok.getKind()) {
default: assert(0 && "Unknown unary op!"); default: assert(0 && "Unknown unary op!");
@ -183,8 +183,8 @@ ASTBuilder::ExprTy *ASTBuilder::ParseUnaryOp(const LexerToken &Tok,
return new UnaryOperatorLOC(Tok.getLocation(), (Expr*)Input, Opc); return new UnaryOperatorLOC(Tok.getLocation(), (Expr*)Input, Opc);
} }
ASTBuilder::ExprTy *ASTBuilder::ParsePostfixUnaryOp(const LexerToken &Tok, Action::ExprResult ASTBuilder::ParsePostfixUnaryOp(const LexerToken &Tok,
ExprTy *Input) { ExprTy *Input) {
UnaryOperator::Opcode Opc; UnaryOperator::Opcode Opc;
switch (Tok.getKind()) { switch (Tok.getKind()) {
default: assert(0 && "Unknown unary op!"); default: assert(0 && "Unknown unary op!");
@ -198,7 +198,7 @@ ASTBuilder::ExprTy *ASTBuilder::ParsePostfixUnaryOp(const LexerToken &Tok,
return new UnaryOperatorLOC(Tok.getLocation(), (Expr*)Input, Opc); return new UnaryOperatorLOC(Tok.getLocation(), (Expr*)Input, Opc);
} }
ASTBuilder::ExprTy *ASTBuilder:: Action::ExprResult ASTBuilder::
ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
ExprTy *Idx, SourceLocation RLoc) { ExprTy *Idx, SourceLocation RLoc) {
if (!FullLocInfo) if (!FullLocInfo)
@ -207,7 +207,7 @@ ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
return new ArraySubscriptExprLOC((Expr*)Base, LLoc, (Expr*)Idx, RLoc); return new ArraySubscriptExprLOC((Expr*)Base, LLoc, (Expr*)Idx, RLoc);
} }
ASTBuilder::ExprTy *ASTBuilder:: Action::ExprResult ASTBuilder::
ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc,
tok::TokenKind OpKind, SourceLocation MemberLoc, tok::TokenKind OpKind, SourceLocation MemberLoc,
IdentifierInfo &Member) { IdentifierInfo &Member) {
@ -221,7 +221,7 @@ ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc,
/// ParseCallExpr - Handle a call to Fn with the specified array of arguments. /// ParseCallExpr - Handle a call to Fn with the specified array of arguments.
/// This provides the location of the left/right parens and a list of comma /// This provides the location of the left/right parens and a list of comma
/// locations. /// locations.
ASTBuilder::ExprTy *ASTBuilder:: Action::ExprResult ASTBuilder::
ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc, ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
ExprTy **Args, unsigned NumArgs, ExprTy **Args, unsigned NumArgs,
SourceLocation *CommaLocs, SourceLocation RParenLoc) { SourceLocation *CommaLocs, SourceLocation RParenLoc) {
@ -234,8 +234,8 @@ ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
// Binary Operators. 'Tok' is the token for the operator. // Binary Operators. 'Tok' is the token for the operator.
ASTBuilder::ExprTy *ASTBuilder::ParseBinOp(const LexerToken &Tok, ExprTy *LHS, Action::ExprResult ASTBuilder::ParseBinOp(const LexerToken &Tok, ExprTy *LHS,
ExprTy *RHS) { ExprTy *RHS) {
BinaryOperator::Opcode Opc; BinaryOperator::Opcode Opc;
switch (Tok.getKind()) { switch (Tok.getKind()) {
default: assert(0 && "Unknown binop!"); default: assert(0 && "Unknown binop!");
@ -279,10 +279,10 @@ ASTBuilder::ExprTy *ASTBuilder::ParseBinOp(const LexerToken &Tok, ExprTy *LHS,
/// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null /// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
/// in the case of a the GNU conditional expr extension. /// in the case of a the GNU conditional expr extension.
ASTBuilder::ExprTy *ASTBuilder::ParseConditionalOp(SourceLocation QuestionLoc, Action::ExprResult ASTBuilder::ParseConditionalOp(SourceLocation QuestionLoc,
SourceLocation ColonLoc, SourceLocation ColonLoc,
ExprTy *Cond, ExprTy *LHS, ExprTy *Cond, ExprTy *LHS,
ExprTy *RHS) { ExprTy *RHS) {
if (!FullLocInfo) if (!FullLocInfo)
return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS); return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS);
else else

View File

@ -88,30 +88,30 @@ public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Primary Expressions. // Primary Expressions.
virtual ExprTy *ParseSimplePrimaryExpr(const LexerToken &Tok) { return 0; } virtual ExprResult ParseSimplePrimaryExpr(const LexerToken &Tok) { return 0; }
virtual ExprTy *ParseIntegerConstant(const LexerToken &Tok) { return 0; } virtual ExprResult ParseIntegerConstant(const LexerToken &Tok) { return 0; }
virtual ExprTy *ParseFloatingConstant(const LexerToken &Tok) { return 0; } virtual ExprResult ParseFloatingConstant(const LexerToken &Tok) { return 0; }
virtual ExprTy *ParseParenExpr(SourceLocation L, SourceLocation R, virtual ExprResult ParseParenExpr(SourceLocation L, SourceLocation R,
ExprTy *Val) { ExprTy *Val) {
return Val; return Val; // Default impl returns operand.
} }
// Binary/Unary Operators. 'Tok' is the token for the operator. // Binary/Unary Operators. 'Tok' is the token for the operator.
virtual ExprTy *ParseUnaryOp(const LexerToken &Tok, ExprTy *Input) { virtual ExprResult ParseUnaryOp(const LexerToken &Tok, ExprTy *Input) {
return 0; return 0;
} }
virtual ExprTy *ParsePostfixUnaryOp(const LexerToken &Tok, ExprTy *Input) { virtual ExprResult ParsePostfixUnaryOp(const LexerToken &Tok, ExprTy *Input) {
return 0; return 0;
} }
virtual ExprTy *ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc, virtual ExprResult ParseArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
ExprTy *Idx, SourceLocation RLoc) { ExprTy *Idx, SourceLocation RLoc) {
return 0; return 0;
} }
virtual ExprTy *ParseMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, virtual ExprResult ParseMemberReferenceExpr(ExprTy *Base,SourceLocation OpLoc,
tok::TokenKind OpKind, tok::TokenKind OpKind,
SourceLocation MemberLoc, SourceLocation MemberLoc,
IdentifierInfo &Member) { IdentifierInfo &Member) {
return 0; return 0;
} }
@ -119,22 +119,23 @@ public:
/// This provides the location of the left/right parens and a list of comma /// This provides the location of the left/right parens and a list of comma
/// locations. There are guaranteed to be one fewer commas than arguments, /// locations. There are guaranteed to be one fewer commas than arguments,
/// unless there are zero arguments. /// unless there are zero arguments.
virtual ExprTy *ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc, virtual ExprResult ParseCallExpr(ExprTy *Fn, SourceLocation LParenLoc,
ExprTy **Args, unsigned NumArgs, ExprTy **Args, unsigned NumArgs,
SourceLocation *CommaLocs, SourceLocation *CommaLocs,
SourceLocation RParenLoc) { SourceLocation RParenLoc) {
return 0; return 0;
} }
virtual ExprTy *ParseBinOp(const LexerToken &Tok, ExprTy *LHS, ExprTy *RHS) { virtual ExprResult ParseBinOp(const LexerToken &Tok,
ExprTy *LHS, ExprTy *RHS) {
return 0; return 0;
} }
/// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null /// ParseConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
/// in the case of a the GNU conditional expr extension. /// in the case of a the GNU conditional expr extension.
virtual ExprTy *ParseConditionalOp(SourceLocation QuestionLoc, virtual ExprResult ParseConditionalOp(SourceLocation QuestionLoc,
SourceLocation ColonLoc, SourceLocation ColonLoc,
ExprTy *Cond, ExprTy *LHS, ExprTy *RHS) { ExprTy *Cond, ExprTy *LHS, ExprTy *RHS){
return 0; return 0;
} }
}; };