merge SemaExpr into ParseExpr.cpp

Swift SVN r554
This commit is contained in:
Chris Lattner
2011-08-13 22:33:33 +00:00
parent 047ecf3b27
commit c863bea58d
8 changed files with 181 additions and 291 deletions

View File

@@ -30,6 +30,7 @@ namespace swift {
class Lexer;
class Sema;
class Expr;
class FuncExpr;
class Stmt;
class BraceStmt;
class Type;
@@ -62,8 +63,6 @@ namespace swift {
class Parser {
llvm::SourceMgr &SourceMgr;
Lexer &L;
ASTContext &Context;
Sema &S;
/// Tok - This is the current token being considered by the parser.
Token Tok;
@@ -71,6 +70,9 @@ class Parser {
Parser(const Parser&) = delete;
void operator=(const Parser&) = delete;
public:
ASTContext &Context;
Sema &S;
Parser(unsigned BufferID, ASTContext &Ctx);
~Parser();
@@ -163,10 +165,14 @@ private:
ParseResult<Expr> parseExprUnary(const char *Message = 0);
ParseResult<Expr> parseExprIdentifier();
Expr *parseExprOperator();
ParseResult<Expr> parseExprNumericConstant();
ParseResult<Expr> parseExprDollarIdentifier();
ParseResult<Expr> parseExprParen();
ParseResult<Expr> parseExprFunc();
Expr *actOnIdentifierExpr(Identifier Text, SMLoc Loc);
FuncExpr *actOnFuncExprStart(SMLoc FuncLoc, Type FuncTy);
// Statement Parsing
ParseResult<Stmt> parseStmtOtherThanAssignment();
ParseResult<BraceStmt> parseStmtBrace(const char *Message = 0);
@@ -174,6 +180,10 @@ private:
ParseResult<Stmt> parseStmtIf();
ParseResult<Stmt> parseStmtWhile();
/// actOnCondition - Handle a condition to an if/while statement, inserting
/// the call that will convert to a 1-bit type.
Expr *actOnCondition(Expr *Cond);
};
} // end namespace swift