diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-02-14 16:05:25 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-02-15 09:27:01 +0100 |
commit | f4163b8ba01cd1a4f5d91c83a3863939b7809375 (patch) | |
tree | 2d14b5bbfdb23896bbea2382db81af49be391862 /src/shared/cplusplus/ASTClone.cpp | |
parent | 2a59d2ae0c889fe6e4ac50a3f110b0103f880c15 (diff) | |
download | qt-creator-f4163b8ba01cd1a4f5d91c83a3863939b7809375.tar.gz |
Added Objective-C @try block parsing.
Diffstat (limited to 'src/shared/cplusplus/ASTClone.cpp')
-rw-r--r-- | src/shared/cplusplus/ASTClone.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/shared/cplusplus/ASTClone.cpp b/src/shared/cplusplus/ASTClone.cpp index d4247ad116..a909db03b7 100644 --- a/src/shared/cplusplus/ASTClone.cpp +++ b/src/shared/cplusplus/ASTClone.cpp @@ -1108,6 +1108,16 @@ ThrowExpressionAST *ThrowExpressionAST::clone(MemoryPool *pool) const return ast; } +ObjCThrowExpressionAST *ObjCThrowExpressionAST::clone(MemoryPool *pool) const +{ + ObjCThrowExpressionAST *ast = new (pool) ObjCThrowExpressionAST; + ast->at_token = at_token; + ast->throw_token = throw_token; + if (expression) + ast->expression = expression->clone(pool); + return ast; +} + TranslationUnitAST *TranslationUnitAST::clone(MemoryPool *pool) const { TranslationUnitAST *ast = new (pool) TranslationUnitAST; @@ -1564,3 +1574,42 @@ ObjCSynchronizedStatementAST *ObjCSynchronizedStatementAST::clone(MemoryPool *po return ast; } +ObjCTryBlockStatementAST *ObjCTryBlockStatementAST::clone(MemoryPool *pool) const +{ + ObjCTryBlockStatementAST *ast = new (pool) ObjCTryBlockStatementAST; + ast->at_token = at_token; + ast->try_token = try_token; + if (statement) + ast->statement = statement->clone(pool); + for (ObjCCatchClauseListAST *iter = catch_clause_list, **ast_iter = &ast->catch_clause_list; + iter; iter = iter->next, ast_iter = &(*ast_iter)->next) + *ast_iter = new (pool) ObjCCatchClauseListAST((iter->value) ? iter->value->clone(pool) : 0); + if (finally_clause) + ast->finally_clause = finally_clause->clone(pool); + return ast; +} + +ObjCCatchClauseAST *ObjCCatchClauseAST::clone(MemoryPool *pool) const +{ + ObjCCatchClauseAST *ast = new (pool) ObjCCatchClauseAST; + ast->at_token = at_token; + ast->catch_token = catch_token; + ast->lparen_token = lparen_token; + if (exception_declaration) + ast->exception_declaration = exception_declaration->clone(pool); + ast->rparen_token = rparen_token; + if (statement) + ast->statement = statement->clone(pool); + return ast; +} + +ObjCFinallyClauseAST *ObjCFinallyClauseAST::clone(MemoryPool *pool) const +{ + ObjCFinallyClauseAST *ast = new (pool) ObjCFinallyClauseAST; + ast->at_token = at_token; + ast->finally_token = finally_token; + if (statement) + ast->statement = statement->clone(pool); + return ast; +} + |